Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Format date display |
Sun, Feb 24 2008 4:34 AM | Permanent Link |
"Bobby Gallagher" | Hi
Is there any way to use the select statement to return a date in a format of my choise i.e SELECT FORMAT(jobdate, 'dd/mm/yy') from jobs Regards Bobby |
Sun, Feb 24 2008 8:47 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Bobby
You don't say which version you're using but I can see two possible solutions 1. write a UDF 2. use EXTRACT and CAST No. 1 is a doddle because you can just use the inbuilt Delphi formatting routines. No. 2 is just a slog to do it but is also fairly simple eg: select _date, CAST(Extract(DAY FROM _date) AS CHAR(2)) +'/'+ CAST(Extract(MONTH FROM _date) AS CHAR(2)) +'/'+ CAST(Extract(YEAR FROM _date) AS CHAR(4)) from tbl Roy Lambert |
Tue, Feb 26 2008 2:41 AM | Permanent Link |
"Bobby Gallagher" | Hi Roy
I am still using V3.30 and hoped that there was a function to display the date - I already use the option 2 suggestion but thought that it was a bit "clunky" Thanks for the help Regards Bobby "Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message news:8E06D30D-AB2A-4C6E-BDBD-6582E238E3CA@news.elevatesoft.com... > Bobby > > You don't say which version you're using but I can see two possible > solutions > > 1. write a UDF > 2. use EXTRACT and CAST > > No. 1 is a doddle because you can just use the inbuilt Delphi formatting > routines. No. 2 is just a slog to do it but is also fairly simple eg: > > select _date, > CAST(Extract(DAY FROM _date) AS CHAR(2)) +'/'+ > CAST(Extract(MONTH FROM _date) AS CHAR(2)) +'/'+ > CAST(Extract(YEAR FROM _date) AS CHAR(4)) > from tbl > > > Roy Lambert > |
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 |