All Forums Database
sk8s3i 35 posts Joined 06/13
08 Oct 2014
Timestamp for the previous day

Hi All,
I have a requirement which goes like this:
My timestamp(6) field, which is, say, myTimeValue contains: 2014-10-08 10:14:51.210000
Now, if I wanted to change this to the previous days value, still retaining the hour, minute, second and millisecond values as it is, how would I do that? What I mean is, if I had to get 2014-10-07 10:14:51.210000 from 2014-10-08 10:14:51.210000, how can that be done in an efficient way?
Please help!
 
Thanks,
Shardul

-Thanks Shardul

Raja_KT 1246 posts Joined 07/09
08 Oct 2014

select myTimeValue -interval '1' day from your_table;

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

sk8s3i 35 posts Joined 06/13
08 Oct 2014

Thanks Raja :)
Silly me.
Thanks again
-Shardul

-Thanks Shardul

You must sign in to leave a comment.