473,378 Members | 1,037 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,378 software developers and data experts.

problems with date and queries

Dear all,

I have a table called Meeting with four columns (parts of the table
below) and DateTime is the primary key and MeetingStudentID a foreign
key . The content of the table is obtained from an Access form and
stored into the table. The DateTime field is from a text box and the
string is converted into date format (CDate(datestring)) before I
store and make queries.

I try to query for a specific date but I there are no rows selected.
It used to work before but not now. I just can't understand why I
can't select rows with a specific date. Can someone please explain why
this goes wrong?

Thank you,
Rgds /Sam

This query doesn't give any rows at all:
"SELECT * FROM MEETING WHERE DateTime = #10/02/2007 14:54:05#;"
DateTime Comments Pending MeetingStudentID
10/02/2007 14:54:05 Everyone No 0123456
10/02/2007 15:01:05 Walking No 0123456
10/02/2007 15:03:51 Alive No 0123456

Fieldname Datatype
DateTime Date/Time
Comments Memo (varchar2(1000))
Pending Yes/No
MeetingStudentID Text

Oct 6 '07 #1
1 1222
On 6 Ott, 15:45, kkuilla <kkui...@hotmail.comwrote:
Dear all,

I have a table called Meeting with four columns (parts of the table
below) and DateTime is the primary key and MeetingStudentID a foreign
key . The content of the table is obtained from an Access form and
stored into the table. The DateTime field is from a text box and the
string is converted into date format (CDate(datestring)) before I
store and make queries.

I try to query for a specific date but I there are no rows selected.
It used to work before but not now. I just can't understand why I
can't select rows with a specific date. Can someone please explain why
this goes wrong?

Thank you,
Rgds /Sam

This query doesn't give any rows at all:
"SELECT * FROM MEETING WHERE DateTime = #10/02/2007 14:54:05#;"

DateTime Comments Pending MeetingStudentID
10/02/2007 14:54:05 Everyone No 0123456
10/02/2007 15:01:05 Walking No 0123456
10/02/2007 15:03:51 Alive No 0123456

Fieldname Datatype
DateTime Date/Time
Comments Memo (varchar2(1000))
Pending Yes/No
MeetingStudentID Text
Try inverting day/month to see if it's a problem with date format

"SELECT * FROM MEETING WHERE DateTime = #02/10/2007 14:54:05#;"

in case, use iso notation when storing to make sure it get it right.

-P

Oct 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: carverk | last post by:
Hello All I'm in the middle of moving a MS Access DB to a MySql backend. I have figured out about 90% of the problems I have faced, execpt for this one. I have 3 Queries, which pull records...
3
by: Reginald | last post by:
I am trying to create a query based on 1 of 3 date fields from a table called "T40". the first date is T40RbtDte, 2nd is T40RbtRecDte, 3rd is T40RbtDueDte. I have created a form to alow the user...
5
by: David B | last post by:
I have a number of queries, running one after the other, which do quite a complex calculation. A text box on a form provides the date for this routine. I have another routine I wish to do and it...
1
by: Igor Kramarsich - EDIT | last post by:
I'm having problems dealing with dates in my queries/SQL code. I need a search digit date. In form define date field without format I receive results. But I go to define date filed with short date...
1
by: zerbie45 | last post by:
I have a high number of computers that at logon write some information to a sql 2005 database. Information such as computer name, user name, logon date and logon time are entered. Because...
3
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
9
by: mharrison | last post by:
Hello, I am developing a small java web-based car-pool booking system app which interacts with an access database. I am trying to write 2 queries: The first which will specify whether a given car...
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
3
by: atiq | last post by:
i have a Query where i have Criteria for two fields as the following: Field :Date of Incident Crirteria: !! And !! Field: StudentSurname Criteria: !! Occasionally, staff may just want...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.