May 14, 2019 at 4:31 pm
Hi,
I have a computed column with this in it:
(case when [Duration]<'00:52' then '00:00' else [Duration] end)
The column Duration is a Time(4) datatype. I need to subtract 52 seconds from it.
For example, one record has 00:01:16.0000, which is 1 minute and 16 seconds, or 60+16 which is 76 seconds.
The problem is that I need to be able to subtract 52 from this and if it is less than zero that is is zero otherwise it is the time in the duration column.
Thank you
May 14, 2019 at 4:46 pm
DATEDIFF with a CASE statement should do it.
May 14, 2019 at 5:00 pm
Sorry, I am not sure how I would use DATEDIFFÂ here, because that needs two dates I think.
Thank you
May 14, 2019 at 5:44 pm
Thank you
I git this to work
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply