By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,479 Members | 2,260 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,479 IT Pros & Developers. It's quick & easy.

date format, Access 2002

P: 20
Hi
When querying data in a table on date, an error is reported stating the data types do not match (error code 3464). The column format is short date, the query considers that and how short date is expressed in my XP. What is the problem?
Thank you
PS. tested query samples would be great
Apr 9 '08 #1
Share this Question
Share on Google+
4 Replies


Expert Mod 2.5K+
P: 2,545
Hi kuzen. For us to help you we need to see your SQL for the query you have tried that is returning the run-time error - could you post this in your next reply please? It would also be useful for you to tell us the field names and data types of the other fields involved, and particularly whatever you are comparing your date field to.

Date/time values are stored internally as numbers, with the date itself stored as a whole number counting the number of days from January 1900. The format of the date does not affect how the date is stored, only how it is displayed.

The most likely source of your error, in my opinion, is that you are comparing a date to a text value representing a date - which may look the same but is actually quite different in all other ways.

-Stewart
Apr 9 '08 #2

P: 20
Hi Stewart
Thanks for the reply.
Here's the query
Expand|Select|Wrap|Line Numbers
  1. SELECT C.NAME AS Имя,C.PROCESSOR AS Процессор,C.MONITOR AS Монитор,A.NAME AS Действие, P.DATE AS Дата, P.NOTES AS Замечания, U.NAME AS Сделал, U1.NAME AS Записал FROM COMPUTERS C, ACTIVITIES A, PCMAINTENANCE P, USERS U, USERS U1 WHERE C.ID=P.COMPUTER AND A.ID=P.ACTIVITY AND P.PERFORMER=U.ID AND P.RECORDER=U1.ID AND C.DEPARTMENT=1 AND P.PERFORMER=1 AND P.DATE >='10.2.2008' AND P.DATE <='10.3.2008';
  2.  
It works without the dates.
Thank you
Apr 10 '08 #3

Expert Mod 2.5K+
P: 2,545
Hi. A revised SQL statement is shown below which corrects the errors in your date comparisons. Dates included as actual values within Access SQL statements (date literals) are delimited by # symbols, not single quotes (which delineate text strings). The separator within the date is the slash mark, /, not the dot.

-Stewart
Expand|Select|Wrap|Line Numbers
  1. SELECT C.NAME AS Имя,C.PROCESSOR AS Процессор,C.MONITOR AS Монитор,A.NAME AS Действие, P.DATE AS Дата, P.NOTES AS Замечания, U.NAME AS Сделал, U1.NAME AS Записал FROM COMPUTERS C, ACTIVITIES A, PCMAINTENANCE P, USERS U, USERS U1 WHERE C.ID=P.COMPUTER AND A.ID=P.ACTIVITY AND P.PERFORMER=U.ID AND P.RECORDER=U1.ID AND C.DEPARTMENT=1 AND P.PERFORMER=1 AND P.DATE >=#10/2/2008# AND P.DATE <=#10/3/2008#;
  2.  
Apr 10 '08 #4

P: 20
Thank you for fast reply, now it works.
Apr 10 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.