Connecting Tech Pros Worldwide Help | Site Map

ASP and Microsoft Access datatype - Date/Time

Member
 
Join Date: Oct 2008
Posts: 58
#1: Apr 6 '09
Hi!

I am using for my project ASP and Microsoft Access.

start date and end date -- In database (Microsoft Access) i set the datatype is Date/Time. It's display error. The error is below:
  • Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
/Travel/Include/Update_Data.asp, line 66
How i can solve this problem? Kindly give some more idea and example..
AND
Fees paid Date:----- In this please i got error... (If they didn't paid fees, i want to pass the value for date is "null or nil") how? pls explain to me... pls help me...

Thanks & Regards,
Susan.
Newbie
 
Join Date: Apr 2009
Posts: 1
#2: Apr 6 '09

re: ASP and Microsoft Access datatype - Date/Time


Most of the times errors like that are due to wrong date format. Format any dates by using yyyymmdd format, which is the most universal format type, before updating your db.
It whould be usefull if you post your code here as I'm only guessing.
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,690
#3: Apr 8 '09

re: ASP and Microsoft Access datatype - Date/Time


Quote:

Originally Posted by vadims View Post

Most of the times errors like that are due to wrong date format. Format any dates by using yyyymmdd format, which is the most universal format type, before updating your db.
It whould be usefull if you post your code here as I'm only guessing.

You're right that that is the issue, and if your solution works, then there is no reason for me to argue, but remember that M$ is a US company and if it will fit in "mmddyy" they assume that is what you mean. I always recommend doing it in "dd mmm yyyy" format (like "12 Jan 2009", or some other format that uses full month name or abbreviation, there is a format in ymd order that is comparable - "2009-January-12") because it is the least ambiguous - M$ access never gets it wrong when you format it like that.

Jared
Expert
 
Join Date: Nov 2007
Posts: 126
#4: Apr 16 '09

re: ASP and Microsoft Access datatype - Date/Time


Susan,

I also remind you that MS Access requires "#" marks around dates in SQL strings.

Example:

INSERT INTO Employees (name, hireDate) VALUES ('Bob', #12-JAN-2009#);
Reply