May 13, 2019 at 6:11 pm
Hi,
I have a field that is a Time(4) datatype.
I need to make a computed field in the table that checks if you subtract 52 secs. from the Time field is 0 then 0 else the time field value.
So I have :
alter table [DMPCRU].[dbo].[VaspianCalls] add [Hold_Time] as (iif(DATEADD(ss,-52,Duration)<0,0,Duration))
But this doe not work:
Comes back with
Operand type clash: time is incompatible with tinyint
Any ideas of what I can do?
Thank you
May 13, 2019 at 6:20 pm
If I understand the desired logic correctly, then this:
alter table [DMPCRU].[dbo].[VaspianCalls] add [Hold_Time] as (iif(Duration < '00:52', '00:00', Duration))
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
May 13, 2019 at 6:22 pm
That did it.
Thanks, I really appreciate your help.
Thank you
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply