View previous topic :: View next topic |
Author |
Message |
newbie
Joined: 01 Oct 2004 Posts: 11
|
Posted: Fri Oct 01, 2004 6:53 pm Post subject: SQL statement problems |
|
|
I have a MS Access database with table called Users. How do I select all users that has been born between 1/1/1970 and 1/1/2000? I've tried the following SQL statement, but I got an error:
Code: | SELECT * FROM Users WHERE DOB > '1/1/1970' AND DOB < '1/1/2000' |
_________________ I'm still learning.. |
|
Back to top |
|
|
administrator Site Admin
Joined: 01 Oct 2004 Posts: 183
|
Posted: Sat Oct 02, 2004 10:51 am Post subject: |
|
|
Instead of the single quotes you have put around your dates you need to use # character. This is the way MS Access expects the dates:
Code: | SELECT * FROM Users WHERE DOB > #1/1/1970# AND DOB < #1/1/2000# |
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|