Reference a Date and Time in Query

T

tmm786

Hello,

I am trying to use a query to filter the table results by Date and
Time. The table data is in the format:

mm/dd/yyyy HH:MM:SS *M

I already have a query that selects the data between two dates. But I
also want to be able to select two dates and two times. Such as
Between 3/15/2007 9:00 AM and 3/15/2007 10:00 AM, or use two different
dates and times, etc.

I have gotten close by using:

Between ([Forms]![RC_WithTime]![Calendar1]+TimeSerial(9,0,0)) And
([Forms]![RC_WithTime]![Calendar2]+TimeSerial(10,0,0))

but as soon as I try to convert the TimeSerial to link to forms it
says that there is an error or it is too complex.

Is there a way to do this?
 
G

Guest

The table data is in the format: mm/dd/yyyy HH:MM:SS *M
What is the asterisk and 'M' after your date and time?

Is the field a text filed or is it a DateTime datatype in your table? It do
make a difference.

If it is a DateTime field you should be able to use this ---
Between [Forms]![RC_WithTime]![Calendar1] And
[Forms]![RC_WithTime]![Calendar2]
and enter date time like this ---
09/17/2007 11:23:00
 
T

tmm786

What is the asterisk and 'M' after your date and time?

Is the field a text filed or is it a DateTime datatype in your table? It do
make a difference.

If it is a DateTime field you should be able to use this ---
Between [Forms]![RC_WithTime]![Calendar1] And
[Forms]![RC_WithTime]![Calendar2]
and enter date time like this ---
09/17/2007 11:23:00

--
KARL DEWEY
Build a little - Test a little



tmm786 said:
I am trying to use a query to filter the table results by Date and
Time. The table data is in the format:
mm/dd/yyyy HH:MM:SS *M
I already have a query that selects the data between two dates. But I
also want to be able to select two dates and two times. Such as
Between 3/15/2007 9:00 AM and 3/15/2007 10:00 AM, or use two different
dates and times, etc.
I have gotten close by using:
Between ([Forms]![RC_WithTime]![Calendar1]+TimeSerial(9,0,0)) And
([Forms]![RC_WithTime]![Calendar2]+TimeSerial(10,0,0))
but as soon as I try to convert the TimeSerial to link to forms it
says that there is an error or it is too complex.
Is there a way to do this?- Hide quoted text -

- Show quoted text -

I was trying to show with the * that it was AM or PM. It is a Date/
TimeField. I think I have gotten it figured out though. I ended up
finding a different Date/Time Picker that worked for what I needed.

Thanks for the reply.
 

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