Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Select Statement - Time in 24hour format |
Fri, Apr 19 2013 2:10 AM | Permanent Link |
Danie van Eeden | Hi,
I'm sure i just missed it in the manual - but is there a way to select the time field (via sql select) into a 24 hour format? (instead of 12 hour AM/PM)? Regards Danie |
Mon, Apr 22 2013 11:35 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Danie,
<< I'm sure i just missed it in the manual - but is there a way to select the time field (via sql select) into a 24 hour format? (instead of 12 hour AM/PM)? >> Do you want to do this formatting as part of the query itself ? If so, then just use the CAST() function (it always uses a 24-hour representation for time values cast as strings): SELECT CAST(MyTimeField AS VARCHAR(20)) FROM MyTable If you want to do it at the TField level of the TDBISAMQuery, you can use the DisplayFormat property: MyDBISAMQuery.Open; MyDBISAMQuery.FieldByName('MyTimeField').DisplayFormat:='h:nn:ss'; Tim Young Elevate Software www.elevatesoft.com |
Tue, Apr 23 2013 3:00 AM | Permanent Link |
Danie van Eeden | Hi Tim,
thank you This "SELECT CAST(MyTimeField AS VARCHAR(20)) FROM MyTable" is what I was looking for. Should have tried it before asking. Thanks again. Danie |
This web page was last updated on Sunday, May 5, 2024 at 07:30 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |