Date time format

  • Thread starter Thread starter Hormuzd Birdie
  • Start date Start date
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.!!
 
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:]
 
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:]
 
Back
Top