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!

comparing dates

Status
Not open for further replies.

tonyjob

Programmer
Nov 20, 2000
25
0
0
GB
im getting a data type mismatch error when i try to compare a date from a text box with a date in a access db, the field in the db is set to short date. im using the following sql statment.

"select * from [members] where [date]= '" & text1 & "';"

db date: 21/01/2001
textbox date: 21/01/2001

i cant see any reason why it doesnt work.

any ideas?
 
Make sure the date from the textbox is formatted as a date, not text.
 
how do i do that? move into another variable before comparing it?
 
"select * from [members] where [date]= #"

& Format(text1,"mm/dd/yyyy") & "#"
Eric De Decker
vbg.be@vbgroup.nl

Licence And Copy Protection AxtiveX
Source CodeBook for the programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top