Criteria for one field be based on another field?

G

Guest

I have a date field with proper a criteria statement to give me the dates I
want. I also need however the time in hours as well. If I start at 1:00PM
one day, then I want to end at 12:00PM at the end date. I can get the dates,
but how do I get the hours to match exactly with the dates? I already have
the hours stored in a table ready to be used in the criteria statement, just
a little confused on how to get out what I need. Example:

8/03/2005 1:00PM
8/05/2005 12:00PM

Instead, I get all the hours for the last date. Can I combine a statement
to the Date field that would read the ending date and the ending time?
Thanks.
 
M

[MVP] S.Clark

Your desired object is not clear. Please repost with more detail. Maybe a
table structure or two as well.

There are several Functions dedicated to working with dates:
DateAdd
DateDiff
Date
etc...
 
G

Guest

Ok...so far I got this in my query:

Column 1

Field: Date
Criteria:
=Dlookup("[BegDAte]","[BegEnd;")and<=Dlookup("[EndDate]","[BegEnd]")
Or: Dlookup("[EndDate]","[BegEnd]")

Colum 2

Field: Time
Criteria: Dlookup("[BegTime]","[BegEnd]")
Or: ?

I know I need something else to reference that end hour(EndTime). Any idea?
 
M

[MVP] S.Clark

This is a disaster. There are far too many syntax errors to even save the
query.

Also, naming field with Time and Date is not recommended.

Kou Vang said:
Ok...so far I got this in my query:

Column 1

Field: Date
Criteria:
=Dlookup("[BegDAte]","[BegEnd;")and<=Dlookup("[EndDate]","[BegEnd]")
Or: Dlookup("[EndDate]","[BegEnd]")

Colum 2

Field: Time
Criteria: Dlookup("[BegTime]","[BegEnd]")
Or: ?

I know I need something else to reference that end hour(EndTime). Any
idea?
 

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