Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 2 of 2 total |
Date Formatting Question |
Sun, May 31 2015 8:28 AM | Permanent Link |
Cfguy | Hi,
I understand that using the command #CURRENTDATE# will insert the current date into text, however I am wondering if there is a way (or command) to specify the format of the inserted current date - e.g. suppose I want the current date to always be inserted in the format YYYY-MM-DD? Any help with this would be greatly appreciated. Thanks, Cfguy |
Sun, May 31 2015 11:01 AM | Permanent Link |
Raul Team Elevate | On 5/31/2015 8:28 AM, Cfguy wrote:
> I understand that using the command #CURRENTDATE# will insert the current date into text, however I am wondering if there is a way (or command) to specify the format of the inserted current date - e.g. suppose I want the current date to always be inserted in the format YYYY-MM-DD? > Any help with this would be greatly appreciated. I'm not aware of the #CURRENTDATE# - where did you read about this one ? There is however a function called CURRENT_DATE which returns a EDB date type which already is in IS0 8601 foramt (YYYY-MM-DD for date). For storing the date in the table you need to use the EDB format or it would not be a valid date value so don't reformat. However if you need to store date in a text field (varchar, clob etc) or simply to display it in a different format then you can use CAST function to do so - for example : "CAST (<myfatefield> as Varchar(10))" will return "YYYY-MM-DD" and if you need something else you can do for example : "CAST (<myfatefield> as Varchar(10) DATE FORMAT 'YYYY/MM/DD')" Raul |
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 |