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

Access date compare datatype problem 1

Status
Not open for further replies.

Genotix

Programmer
Dec 16, 2004
53
0
0
NL
Hey guys,

I've got a problem withe the WHERE clausule of my query.
In my database records are stored and all have a field Start_Timestamp and Stop_Timestamp (both Date/Time format)

When I execute a query like :
Code:
SELECT * FROM table WHERE number = 1000 
  AND Start_Timestamp > '1-3-2005 14:32:17'
  ORDER BY number

I get an error saying the data types aren't correct.
Is there a way to convert '1-3-2005 14:32:17' to the right date format?
Or is there something else I'm doing wrong here?

Linux IS userfriendly.
It's only very selective about who it's friends are.
 
If you are using MS Access you need to surround the Date value with the '#' character. Try something like this
Code:
SELECT * FROM table WHERE number = 1000 
  AND Start_Timestamp > #1-3-2005 14:32:17#
  ORDER BY number

zemp
 
Thanx for the tip!

Linux IS userfriendly.
It's only very selective about who it's friends are.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top