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

SQL and dates

Status
Not open for further replies.

midnightswan

Programmer
Joined
Nov 11, 2002
Messages
7
Location
AU
Hi,

I'm having a problem when trying to select a record from an Access database with ASP.
Here's the statement

sql = "SELECT * FROM Day_Log WHERE Day_Log.Employee='" & employee & "' AND Day_Log.dWorked=#" & dateEntered & "#"

set rsCheck = dbConnection.execute(sql)

for the value of dateEntered, if something like 10/9/2002 (d/m/yyyy) is entered Access swaps the days and months around to do the search (so it turns into 9/10/2002) and comes back saying there is no record that contains that date. The thing is, Access is displaying the dates I insert into the database correctly as (d/m/yyyy) but stuffs up when I try to find records. Can anyone please help me figure out a way around it or how I can fix it up.

Thanking you,
MS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top