Re: need help creating criteria for time

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



In query design, type this expression into the *Field* row:
[TheDate] + [TheTime]

You can now put your criteria in the Criteria row under this field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"bluezcruizer" <bluezcruizer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:89F9C3AE-9C89-405F-9C7D-C6AB402A3C5C@xxxxxxxxxxxxxxxx
I'm not completely sure I follow...we'll have to go with 2 different
fields
because of other requirements.

I've changed the field names to "TheDate" and "TheTime" as per your
recommendations.

So in my query, I have the field names, the first two are "TheDate" and
"TheTime"

How do I list these in the parameters box that pulls up? Do I leave
anything in the Criteria for those fields?

Thank you.
bluezcruizer

"Allen Browne" wrote:

Simplest solution would be to use just one field that contains the date
and
time. You could the type your criteria into the query as:
> [After what date and time?]
(Note: include the greater than sign.)
Then choose Parameters on the Query menu.
In the dialog that opens, enter:
[After what date and time?] Date/Time
All done.

If you want to continue with the 2 different fields, make sure they are
not
named Date and Time. Those are both reserved words in JET. We will use
TheDate and TheTime for this example.

Now in your query, enter this into the Field row:
[TheDate] + [TheTime]
and then continue to add the criteria and declare the parameter in the
same
way as desribed above for a combined date/time field.

to group, rather than allenbrowne at mvps dot org.

"bluezcruizer" <bluezcruizer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2879FBF4-CEFE-4660-A74B-6FB0946BE0A3@xxxxxxxxxxxxxxxx
Hi.
I'm trying to create a query that will return records from a specified
date
and after a specified time.

So far, I've got the table set with 2 fields; one for "date" and the
other
for "time". Both are auto inputted as the record is generated.

The query I've got I have the date criteria as [Date?]
to
return records for a specified date, and am having trouble with the
time
side
of the coin. I've currently got >[Time?] but that seems
to
return any records regardless of what time it was inputted.

So what I'm trying to do is return say any records inputted after
2:30pm
on
7/17/06.

Please help -- thanks.

bluezcruizer





.



Relevant Pages

  • Re: need help creating criteria for time
    ... Allen Browne - Microsoft MVP. ... I then removed the criteria and left everything else and ran it ... Now let's verify that these date/time fields have *only* date or time, ... If you switch your query to SQL View (View menu, ...
    (microsoft.public.access.queries)
  • Re: need help creating criteria for time
    ... Both fields are Date/Time type. ... Allen Browne - Microsoft MVP. ... I then removed the criteria and left everything else and ran ... If you switch your query to SQL View (View menu, ...
    (microsoft.public.access.queries)
  • Re: part of multi search query non-functional
    ... solution would be to leave the criteria out of the query, ... Search form - Handle many optional criteria ... Allen Browne - Microsoft MVP. ... Locate the WHERE clause. ...
    (microsoft.public.access.queries)
  • Re: need help creating criteria for time
    ... Allen Browne - Microsoft MVP. ... I then removed the criteria and left everything else and ran it ... Now let's verify that these date/time fields have *only* date or time, ... If you switch your query to SQL View (View menu, ...
    (microsoft.public.access.queries)
  • Re: need help creating criteria for time
    ... query returned zero results. ... You can now put your criteria in the Criteria row under this field. ... Allen Browne - Microsoft MVP. ...
    (microsoft.public.access.queries)