Jerry C.k stelde dit idée voor :
Assume
I have 3 field in my query
Counter TransactionDate Time
C1 23/11/2004 8.00AM
C1 23/11/2004 10.00PM
C2 23/11/2004 11.00PM
C1 24/11/2004 1.00AM
C1 24/11/2004 5.00AM
C2 24/11/2004 7.00AM
C1 24/11/2004 8.00AM
C1 24/11/2004 10.00PM
CI 25/11/2004 1.00AM
I would like to retreive the counter by using the date and time....example
enter the begin date (23/11/2004 and 10.00PM) to end date(24/11/2004 and
6.00AM) The data will be in between the starting datetime on 23/11/2004 to
the end datetime.
The data will be capture like below
Counter TransactionDate Time
C1 23/11/2004 10.00PM
C2 23/11/2004 11.00PM
C1 24/11/2004 1.00AM
C1 24/11/2004 5.00AM
Thx...
The first problem is that your date and time fields are separated from
each other.
The second problem is that you have to compare the date and time
_together_ in order to determine if a record is between the entered
values.
The solution :
Add a field to your query :
Expr1: CDate([transactionDate] & " " & [time])
In that column, add the following criteria:
Between CDate([BeginDate] & " " & [BeginTime]) And CDate([EndDate] & "
" & [EndTime])
Remove all other criteria
Set up parameters for BeginDate, BeginTime, EndDate and EndTime (all
date/time)
Now when you run the query, and enter your citeria 23/11/2004,
24/11/2004, 10.00PM and 6.00AM, the correct data shows up...
--
Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. When I snap my fingers, you cannot
imagine why you ever felt otherwise.