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

problems with date and queries

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.