Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Time addition in SQL query |
Wed, May 6 2009 3:55 PM | Permanent Link |
"Halim" | I have 3 fields fields:
Fieldname Type LastUsedDate Date LastUsedTime TIME MinutesLeft Integer I would like a query to get me the expiration datetime using the = follwoing formula: ExpirationDatetime =3D LastUsedDate+LastUsedTime+MinutesLeft I want The ExpirationDatetime to be a timestamp field. I can't figure out how to add minutes to a time field then concatenate = the result with a date field to obtain a timestamp. Thank you, -Halim |
Fri, May 8 2009 5:33 AM | Permanent Link |
"John Hay" | Halim
>I have 3 fields fields: >Fieldname Type >LastUsedDate Date >LastUsedTime TIME >MinutesLeft Integer >I would like a query to get me the expiration datetime using the follwoing formula: >ExpirationDatetime = LastUsedDate+LastUsedTime+MinutesLeft >I want The ExpirationDatetime to be a timestamp field. How about SELECT CAST(CAST(LastUsedDate AS CHAR(10))+' '+CAST(LastUsedTime AS CHAR(8)) AS TIMESTAMP)+(MinutesLeft*60000) FROM Table John |
Fri, May 8 2009 9:23 AM | Permanent Link |
"Halim" | I like it.
Thank you John, -Halim "John Hay" <j.haywithoutdot@crbsolutionsremoveallthis.co.uk> wrote in message news:A9308167-2BCF-4340-902B-180CC5726603@news.elevatesoft.com... > Halim >>I have 3 fields fields: > >>Fieldname Type >>LastUsedDate Date >>LastUsedTime TIME >>MinutesLeft Integer > > >>I would like a query to get me the expiration datetime using the follwoing > formula: >>ExpirationDatetime = LastUsedDate+LastUsedTime+MinutesLeft >>I want The ExpirationDatetime to be a timestamp field. > > How about > > SELECT CAST(CAST(LastUsedDate AS CHAR(10))+' '+CAST(LastUsedTime AS > CHAR(8)) > AS TIMESTAMP)+(MinutesLeft*60000) FROM Table > > John > > > |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |