Date/Time fields with Parameter Query

A

alicia

Avi, thanks for your response. I tried your
recommendation below and the query runs though I get null
records when there are 800+ for a given admit date. When
I add "between 9/15/03 and 9/16/03" in the criteria line
of the admit field I get results. Any other ideas
anyone? Thanks again, Alicia
-----Original Message-----
I assume that you are running a query to pull the data.

Try this:

create a new column in your query as follows:

xDate=Format(Admit_Date,"mm/dd/yy")

in the criteria of xDate write: [Enter Admit Date]

When the query runs it will prompt for the date: Enter the
desired date. Let say 9/19/03. The query will pull only
records that contain Admit_Date = 9/19/03.

Cheers,


Avi


-----Original Message-----
I am inporting data from an Oracle Database that has a
field called Admit_Date which is a date/time field. I
want to specify a date range for specific admit dates,
for example, I want all admits for 9/18/03. The field I
pull this from has date and time, therefore it needs
a "between" parameter (to get everything after midnight
the day of and before midnight the next date. I wrote
the follwing in the criteria for the Admit_Date field:
=[Enter admit date] And <[Enter admit date]+1 hoping I
would only have to enter, for example 9/18/03 one time.
This doesn't work. Any other ideas? Thanks to all!
Alicia
.
.
 
J

John Vinson

I am inporting data from an Oracle Database that has a
field called Admit_Date which is a date/time field. I
want to specify a date range for specific admit dates,
for example, I want all admits for 9/18/03. The field I
pull this from has date and time, therefore it needs
a "between" parameter (to get everything after midnight
the day of and before midnight the next date. I wrote
the follwing in the criteria for the Admit_Date field:
=[Enter admit date] And <[Enter admit date]+1 hoping I
would only have to enter, for example 9/18/03 one time.
This doesn't work. Any other ideas? Thanks to all!
Try:

= CDate([Enter admit date:]) AND < DateAdd("d", 1, CDate([Enter admit date:]))

The CDate will cover for people entering in unexpected date formats.
 

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