Mark Wilson
asked on
DATEADD to certain Datetime fields
SQL Server 2012
I have a datetime field, examples of data in below
2018-10-17 23:00:00.000
2018-11-12 00:00:00.000
I want to add an hour to the field if it has a time 23:00:00.000 attached to it, but leave it as is if it has a time of 00:00:00.000. I know I can do case when time = 23:00:00 etc. Just wandered if theres a neater way of doing it?
Thanks
I have a datetime field, examples of data in below
2018-10-17 23:00:00.000
2018-11-12 00:00:00.000
I want to add an hour to the field if it has a time 23:00:00.000 attached to it, but leave it as is if it has a time of 00:00:00.000. I know I can do case when time = 23:00:00 etc. Just wandered if theres a neater way of doing it?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
A neater way? Not really. Adding an hour will take it to the next day, so just verify that is really what you want to do.