Search within time range

G

Guest

I hope someone with the brains of Access can answer this problem...

I am using Microsoft's QBF query/form technique to search records
(KB304428), Everything works great. I would like to change the results t go
to a report instead of a query results page but I think I may be able to
manage that on my own.

At any rate, the problem is in my table- I have 2 fields wih StartTime and
EndTime. Now, on the form I have a Time field. What I would like to do is be
able to enter a time into the time field and have the query show results that
match within the range of the StartTime and EndTime.

So, for example, I type 12:30 in the Time field on the form and press the
button to get the results. the query will display all records that have an
EndTime of 1:00 and a StartTime of 12:00. Get it? I would really appreciate
any help you can offer. Thanks1 :)
 
G

Guest

couldn't get that to work. I pasted that in the criteria area of my SartTime
and EndTime fields on the query. Then I opened the form and typed 12:00 pm in
the Time textbox and the search results were empty.

I have a record with the [StartTime] at 12:00 pm and the [EndTime] at 1:00
pm. So when I put 12:30 pm in the [Time] field on the form I want that record
to be displayed. I made another field in the query and called it- TimeDiff:
([EndTime]-[StartTime]) but when I put the time 12:30 pm in the [Time] field
on the form it does not search the RANGE of the 2 times it is trying to
search for an exact match of the difference betwen te 2 times. I want to
search the range of the 2 time fields in the query.

Thanks!
 
G

Guest

AH! Yes! I got it. AWESOME! Just like Apple Pie. I put the Between in the
criteria section of the query and the Where part in the field title of the
query- then it worked!

UR the bomb! :D

riKo said:
couldn't get that to work. I pasted that in the criteria area of my SartTime
and EndTime fields on the query. Then I opened the form and typed 12:00 pm in
the Time textbox and the search results were empty.

I have a record with the [StartTime] at 12:00 pm and the [EndTime] at 1:00
pm. So when I put 12:30 pm in the [Time] field on the form I want that record
to be displayed. I made another field in the query and called it- TimeDiff:
([EndTime]-[StartTime]) but when I put the time 12:30 pm in the [Time] field
on the form it does not search the RANGE of the 2 times it is trying to
search for an exact match of the difference betwen te 2 times. I want to
search the range of the 2 time fields in the query.

Thanks!

MGFoster said:
WHERE Forms!frmMyForm!txtTime BETWEEN StartTime And EndTime
 

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