Search Function
dd/mm/yy input format on date search
Help
I have written a search page which searches via a date range.
My problem is that the user must input date in mm/dd/yy format for search to function correctly.
In Australia, we use dd/mm/yy format.
SQL reads
SELECT *
FROM Catalogue
WHERE Date_paid BETWEEN #var1# AND #var2#
Anyone have any ideas?
Comments
date formats
I am not sure which Database you are using, but the mm/dd/yyyy is the US version for Dates, and I know for a fact SQL server default to it unless you change it.
Although reading again you Between statement with the # I haev to assume you are not using SQL server, maybe Access or MySQL.
I do not remember Access having any problem with Dates, but to be certain, in your table select the date column and check the properties at the base, which include a mask, you can set this to dd/mm/yyyy.
If you are using MySQL..then must be honest...not certain where you would set the date.
If you are using an ODBC to talk to the database, check that if it has a Language setting it is not set to the default which is English..but is actually US English, and thus uses US dates.
I hope this helps in some way.
A quick suggestion
An easy but somewhat cumbersome way of doing it would be to have drop downs.
1 for day, 1 for month and 1 for year. This way the user enters the date in the way they expect and you get the right result for your sql search.
Keith
DATE sEARCH
Can u give the search examples by using Two textboxes in Access in Ukdate format?
Thanks
You must me logged in to write a comment.