Check if UK date is bewteen two dates in SQL

WDJohn

New Member
I need to check that a UK date, stored as string in the format dd/mm/yyyy in a database table (\[code\]postmeta.event_date\[/code\]), is between two dates using SLQ format \[code\]BETWEEN 'yyyy-mm-dd' AND 'yyyy-mm-dd+28'\[/code\]. I'm ok with working out the dates to check between, it's the date to check that I'm having issues with because it is in the wrong format for SQL.I have no way of changing the format of the date to check, as it is attached to a post, and I don't know what posts to get out of the database until I can check if they are between my chosen dates...Any ideas if this is possible, or am I looking at two queries (grab all the posts get the IDs of the ones that I actually want by checking the data in PHP)? Thanks.
 
Back
Top