Forums
This topic is locked
Access Date
Posted 14 Sep 2001 18:38:14
1
has voted
14 Sep 2001 18:38:14 Glenn Campbell posted:
I have a little problem. I am using access 2000 and I am designing a program that uses a dates and times to show some of the records.I have a page that allows a user to select records by date, but as soon as the page loads it tells me.
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
/1019master/1019ViewTechStatus.asp, line 37
I know the problem is that I have the date format on the database and for some reason I cannot query it.
When I change the date format on the database to TEXT then it runs fine, but I cannot sort the records.
Can someone please help me? I need this to finish up my project at work.
Replies
Replied 14 Sep 2001 19:38:22
14 Sep 2001 19:38:22 Owen Eastwick replied:
Post your SQL SELECT statement and I'll take a look.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 14 Sep 2001 20:43:40
14 Sep 2001 20:43:40 Glenn Campbell replied:
"SELECT * FROM TechStatus WHERE UpdateDate = '" + Replace(rsTechStatus__MMColParam, "'", "''" + "' ORDER BY TechNumber, UpdateTime"
* I guess that I need to put something to tell it to grab the date/time field instead of trying to read Text from the date/time field.
- Glenn
* I guess that I need to put something to tell it to grab the date/time field instead of trying to read Text from the date/time field.
- Glenn
Replied 14 Sep 2001 23:35:29
14 Sep 2001 23:35:29 Owen Eastwick replied:
Glenn,
Yes, you are trying to look for UdateDate as a text string, which is why you are getting a Data Type mismatch.
DateTime is numeric so it doesn't want to be in quotes.
For example:
='varName' - looks for a text string
LIKE 'varName' - looks for a text string
= varName - looks for a numeric value
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Yes, you are trying to look for UdateDate as a text string, which is why you are getting a Data Type mismatch.
DateTime is numeric so it doesn't want to be in quotes.
For example:
='varName' - looks for a text string
LIKE 'varName' - looks for a text string
= varName - looks for a numeric value
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 15 Sep 2001 04:36:03
15 Sep 2001 04:36:03 Glenn Campbell replied:
Thank you very much for the answer. After you told me, I told myself. DUHH!!! I knew that it was something simple!
Again, Thank you for your help!
- Glenn
Again, Thank you for your help!
- Glenn