Date time format

H

Hormuzd Birdie

I have a field applied of type date/time in an Access2000
db. I want to search this field for a date only input. For
example if the field is filled with
8/11/2003 04:24:00

and my input is only 8/11/2003. The query I used was

select * from mytable where format(applied,"MM/DD/YYYY")
=#8/11/2003#.

I get no results. Can some one help me.!!
 
J

John Vinson

I have a field applied of type date/time in an Access2000
db. I want to search this field for a date only input. For
example if the field is filled with
8/11/2003 04:24:00

and my input is only 8/11/2003. The query I used was

select * from mytable where format(applied,"MM/DD/YYYY")
=#8/11/2003#.

I get no results. Can some one help me.!!

That's because Format() returns a String, not a date.

Try

SELECT * FROM MyTable WHERE DateValue([Applied]) = [Enter date:]
 
K

Kent Prokopy

Try this, It will run faster:

SELECT * FROM MyTable WHERE
[Applied] >= #08/024/2003#
AND
[Applied] < #08/025/2003#

John Vinson said:
I have a field applied of type date/time in an Access2000
db. I want to search this field for a date only input. For
example if the field is filled with
8/11/2003 04:24:00

and my input is only 8/11/2003. The query I used was

select * from mytable where format(applied,"MM/DD/YYYY")
=#8/11/2003#.

I get no results. Can some one help me.!!

That's because Format() returns a String, not a date.

Try

SELECT * FROM MyTable WHERE DateValue([Applied]) = [Enter date:]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top