Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Help with incrementing a DateTime field |
Mon, Dec 8 2008 6:12 PM | Permanent Link |
Norman Rorke | I'm trying to increment a DateTime field by given number of days.
I tried using the sql statement "UPDATE XTABLE SET MY_DATE=MYDATE + 7" but this has no effect at all. Help please !! Norman Desktop Financials Ltd |
Mon, Dec 8 2008 6:37 PM | Permanent Link |
Fernando Dias Team Elevate | Norman,
> I'm trying to increment a DateTime field by given number of days. > > I tried using the sql statement "UPDATE XTABLE SET MY_DATE=MYDATE + 7" > but this has no effect at all. That's because TIMESTAMP field values are internally stored as cumulative milliseconds, so what you are in fact doing is adding 7 milliseconds to MYDATE, not 7 days. So, to add 7 days to MYDATE you must actually add 604800000 = 7*24*60*60*1000 = number of milliseconds in 7 days : UPDATE XTABLE SET MY_DATE=MYDATE + 604800000 -- Fernando Dias [Team Elevate] |
Mon, Dec 8 2008 6:46 PM | Permanent Link |
Norman Rorke | Fernando,
Thanks for the quick response Norman |
This web page was last updated on Wednesday, May 15, 2024 at 08:40 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |