kenuk110
asked on
How to minus 6 hours from a timestamp?
Hi,
I have a need to minus 6 hours from a time stamp if the current timestamp is greater than the current time.
I have attached the script for you to see.
Not sure what I'm doing wrong here.
Any help would be much appreciated.
Regards
Ken
I have a need to minus 6 hours from a time stamp if the current timestamp is greater than the current time.
I have attached the script for you to see.
Not sure what I'm doing wrong here.
Any help would be much appreciated.
Regards
Ken
UPDATE SMSIN_copy
SET validDate = realdate - 6 hour
where realdate > CURRENT_TIMESTAMP()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the quick response!
I ran the script but I get an odd output, below is just one of the results
realdate = 2008-10-21 12:30:43
but
validDate = 2008-10-21 10:14:43
Any ideas??
Thanks
I ran the script but I get an odd output, below is just one of the results
realdate = 2008-10-21 12:30:43
but
validDate = 2008-10-21 10:14:43
Any ideas??
Thanks
ASKER
Brilliant, works perfectly. Cheers.
UPDATE SMSIN_copy
SET validDate = realdate - (6 * 60 * 60)
where realdate > CURRENT_TIMESTAMP()