Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querys

Status
Not open for further replies.

Fensbo

Programmer
May 19, 2005
12
SE
Tables: Customer
Name
...
Cars
Autonumber (key)
Date
Costs
Houses
Autonumber (key)
Date
Costs
Yachts
Autonumber (key)
Date
Costs

If I make a query that looks like this:

SELECT Customer.Name, Cars.Date, Cars.Costs, Houses.Date, Houses.Costs, Yachts.Date, Yachts.Costs
FROM Customer, Cars, Houses, Yachts (they are joined, takes to much to write all the Customer LEFT JOIN Cars ON...bla bla...)
WHERE Customer.Name=[Name:] AND Cars.Date=Date() AND Houses.Date=Date() AND Yachts.Date=Date()

...and for instance Cars.Date is yesterdays date then the whole string would become empty even if Houses.Date and Yachts.Date is todays date. Any way to avoid that?! I want the rest of the data even if one of the dates does not match the criteria...?! :S
 
Hi!

Try:

WHERE Customer.Name=[Name:] AND (Cars.Date=Date() OR Houses.Date=Date() OR Yachts.Date=Date())

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top