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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with date query 1

Status
Not open for further replies.

Appollo14

Technical User
Sep 4, 2003
182
GB
Hi,

I'm getting some strange results with a date query that i'm using. Sometimes it will display the correct results sometimes not. At times i have to use a months date range just to get anything at all to display.

The query i'm using is;

stLinkCriteriaMain = WHERE & " [tbJob].[OrderDate] >= #" & Me.txtDateFrom & "# And [tbJob].[OrderDate] <= #" & Me.txtDateTo & "#"

Any ideas where i'm going wrong?

Regards,
Noel.
 
Guessing your regional settings date format differs from US?

Try:

[tt]" [tbJob].[OrderDate] >= #" & format$(Me.txtDateFrom, "yyyy-mm-dd") & _
"# And [tbJob].[OrderDate] <= #" & format$(Me.txtDateTo, "yyyy-mm-dd") & "#"[/tt]

See International Dates in Access for more info.

Roy-Vidar
 
Thanks Roy, that seems to have done the trick.

Regards,
Noel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top