473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

date format, Access 2002

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
4 2190
Stewart Ross
2,545 Expert Mod 2GB
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
kuzen
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
Stewart Ross
2,545 Expert Mod 2GB
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
kuzen
20
Thank you for fast reply, now it works.
Apr 10 '08 #5

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

Similar topics

7
by: vnl | last post by:
I'm trying to run a SQL query but can't find any records when trying to select a certain date. Here's the sql: SELECT field 1, field2, date_and_time, FROM table1 WHERE date_and_time =...
8
by: Ishbel Kargar | last post by:
Since upgrading from old laptop (Windows 98) to new laptop (Windows XP), my mail-merge letters are doing strange things with date formats. For instance, my reminder letter for lapsed subs carries...
1
by: Wayne Aprato | last post by:
I have a client who is running several Access 97 databases that I have written for them. They are about to upgrade to Access 2003. Is the default file format of Access 2003 still Access 2000 the...
1
by: Bruce Cushman | last post by:
My DB is Access 2000 based "possibly written in 2002" and I have to send and receive update files, ported to a UNIX server by FTP, DB unknown. The file content uses a fixed length string, zero...
2
by: Larry R Harrison Jr | last post by:
I have an unbound text box on an unbound form. I have its default value set to =Date(). The format row under properties says mm/dd/yyyy. It is totally unbound to anything. But rather than today's...
4
by: rzhang | last post by:
Hi, We have an Access Application which works fine for most of the users. But there is one user who has the date input problem. When he enter a date field from a form, i.e. 09/03/2004 (Sept....
0
by: UBI | last post by:
Vorrei suggerire una funzione completa per la differenza fra due date. (questo è codice freeware, niente di illegale) La funzione seguente permette il calcolo di una differenza precisa tra due...
7
by: Andy Davis | last post by:
I have a table of data in Access 2002 which is used as the source table for a mail merge document using Word 2002 on my clients PC. The data is transferred OK but I've noticed that any dates which...
2
by: x | last post by:
hi i am a pilot by profession. i want to create a database of my logbook using ms access 2002. i am facing a problem regarding the format of time field. when i select "Data/Time" data type for my...
2
by: KayC | last post by:
Hi, I run Access 2002 SP3. I have rolled out a FE database to different machines. On one particular machine the date format settings are different in Access. Does anyone know how to change this? I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.