Jump to content

[SOLVED] non-standard date format comparison - help


AndyB

Recommended Posts

I managed to force ISO standard date formats for user entries in a database, but forgot that the client can also enter dates.  Unsurprisingly, the Australian client has entered dates (in a different field) in the Oz-style dd/mm/yyyy.

 

I need a query that effectively chooses records where Oz-style date is between two ISO-style dates:

 

SELECT ... WHERE iso_date1>Oz_date and iso_date2<Oz_date ORDER by Oz_date

 

Nothing is jumping out of the ref manual that seems to apply.  I'm sure it's blindingly obvious, but not to me.

Thanks, Barry.  After the query failed miserably during localhost testing, I decided to move it to the client's server and it worked. The production server control panel declines to reveal what MySQL release is running.

Have you tried

 

VERSION()

Returns a string that indicates the MySQL server version.

mysql> SELECT VERSION();

        -> '3.23.13-log'

 

Note that if your version string ends with -log this means that logging is enabled.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.