tyedyejenn
Programmer
My program is written in VB6 and accesses an Access 97 database. In my table I have a field called DateEntered that has a data type of date/time. In my program I have a variable called strActivityDate. I have tried to declare strActivityDate as a variant, a string and a date and I keep getting
"Data Type Mismatch in criteria expression"
here is my sql statement
"Select * from TrafficSheetsSentToAgents Where TrafficSheetsSentToAgents.AgentNumber =" & "'" & Trim(strLookUpAgent) & "'" & " and TrafficSheetsSentToAgents.DateEntered = " & "'" & strActivityDate & "'" & ""
If I change the datatype in the table to text I don't get the error however then I have to contend with different formats of date from 150 users. Any help is GREATLY appreciated and needed. Thank you in advance
Jenn
"Data Type Mismatch in criteria expression"
here is my sql statement
"Select * from TrafficSheetsSentToAgents Where TrafficSheetsSentToAgents.AgentNumber =" & "'" & Trim(strLookUpAgent) & "'" & " and TrafficSheetsSentToAgents.DateEntered = " & "'" & strActivityDate & "'" & ""
If I change the datatype in the table to text I don't get the error however then I have to contend with different formats of date from 150 users. Any help is GREATLY appreciated and needed. Thank you in advance
Jenn