Greetings!

i am using date in my program. My databasefield <draw_date> declared as shortdate in msaccess.

when i use in the programs

.Open "Select *From numgroup Where Draw_date = '" & DateValue(vdrawdate.Text) & "'", strconek, adOpenStatic, adLockOptimistic

I received error message.. Data Type mismatch in the criteria and sometimes Error 13

Anybody can help to use date as conditional statement..

thank you in advance

With the single ticks ' surrounding your date, you are telling the database that you are passing a string. Try removing the single ticks or surrounding the date with # signs.

Good Luck

you need to format the input to date for before passing the same to database for processing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.