I am trying to generate a query based on dates input by the users in a text box with an input mask, and users will input dd/mm/yyyy. I am using an access front end on an sql server. The server is read only.
I am using VBA and DAO to generate the records and query.
I am having a problem with dates and it is essentially is due to the SQL server date format. I can query using US style dates on input, but not UK format.
I have my code referencing dates here, I have tried format() and cdate(), with no success. Could anyone advise if there is another way of doing this?
mySQL = mySQL + vbCrLf & " ((format([Product].[Startdate], 'dd/mm/yyyy'))>=#" & txtFrom & "#)"
I am using VBA and DAO to generate the records and query.
I am having a problem with dates and it is essentially is due to the SQL server date format. I can query using US style dates on input, but not UK format.
I have my code referencing dates here, I have tried format() and cdate(), with no success. Could anyone advise if there is another way of doing this?
mySQL = mySQL + vbCrLf & " ((format([Product].[Startdate], 'dd/mm/yyyy'))>=#" & txtFrom & "#)"