Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing dates between forms bug

Status
Not open for further replies.

Bristowj

Programmer
Jul 4, 2001
7
GB
I have two access forms. The first is a standard form and has two text boxes used to search on date ranges. If I enter a date range in engilsh format.ie. DD/MM/YYYY and pass it to the second form as an argument variable, the second form is a tabular form and displays the results using an American date range i.e. MM/DD/YYYY.
Both the Access settings and my system setting are set to English.
For example.
I search on all records from 1/1/2001 - 1/2/2001 wanting to bring back all records from Jan - Feb.
The results displayed on the second screen come back as
all records for the first and second of Jan.
As access has semi-intelligent date formatng if I type from the 13th of any month onwards in UK format it works out what I am trying to do and brings back the correct results set.
I have tested the value of the variable in a msgbox and it seems to look OK ( => #1/1/2001# and =< #1/2/2001# ).
Can anyone help!!!

 
If you have created your datasource in the second form from a dynamic SQL statement, remember that date formats in SQL are American !!!
 
In additional to GBall's said: use Format function for composition of SQL and criterias.
format(MyDate, &quot;mm-dd-yyyy&quot;)

Aivars


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top