Query Expression

G

Guest

My database has three date fields. I can query field 1 for <What date? I want
to also include in query other fields if they are also < field 1 date, but
not list if > than field 1 date. This is for producing a report with all
products listed with < what date, all on one report vs. three different
reports.
 
J

John Vinson

My database has three date fields. I can query field 1 for <What date? I want
to also include in query other fields if they are also < field 1 date, but
not list if > than field 1 date. This is for producing a report with all
products listed with < what date, all on one report vs. three different
reports.

Sounds like a possible table design flaw, but...

Put in two calculated fields in your Query:

SearchDate2: IIF([date2] < [date1], [date2], [date1])
SearchDate3: IIF([date3] < [date1], [date3], [date1])

and put the criteria on these two fields in addition to [date1]. Put
the criteria on three different lines so it will use OR logic.

John W. Vinson[MVP]
 

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

Similar Threads

DMax expression 2
Access query 7
Multi dated query 3
Using DateAdd and IIF conditions in a Query 2
Running Query on memo field - character limit 4
query using an expression 7
Date search query 0
Expression 2

Top