Click here to Skip to main content
14,304,152 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi everyone i'm using VB 6.0

and I'm having an error in my sql code.. that is show below..
its always says that Data Type mismatch in criteria expression..


Private Sub Command1_Click()
Adodc1.RecordSource = "select * from Test1 where BDate between BDate >= '" & (Dt1.Value) & "' and BDate <= '" & (Dt2.Value) & "'"
Adodc1.Refresh
End Sub


Please give me an advice if my format is correct..
Thanks for advance!
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

if the Database is MS ACCESS then use # instead '. Also check the column BDate is date type or not. Your code only works if the column is date type. Otherwise you should use conversions.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100