Jump to content

SQL date format


This topic is 381 days old. Please don't post here. Open a new topic instead.

Recommended Posts

1 minute ago, Amedeo said:

With executesql script, date Is in format MM-DD-YYYY.

Not sure what you're referring to. If you're using the ExecuteSQL() function, then you will get dates in YYYY-MM-DD format. If you want another format, you can either reformat the date in the SQL query itself or post-process the SQL result. There is also an (undocumented) option to get the dates "as entered". Which option is best for you depends on what exactly you're doing and for what purpose.

 

Link to comment
Share on other sites

  • 3 weeks later...

there is the trick of concatenating an empty string before the field;

ExecuteSQL ( "SELECT dte FROM ...
//returns 2022-10-20

ExecuteSQL ( "SELECT ''||dte FROM ...
//returns 10/20/2022  (how it was entered)

 

Edited by rivet
  • Thanks 1
Link to comment
Share on other sites

This topic is 381 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.