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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i use an or clause

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
GB
Hi,

I'm a bit new to access and am very stuck on something that is probably very simple.

This is my sql:

SELECT DISTINCT Qry_TeamHol.StaffName, Qry_TeamHol.[Holiday Start Date], Qry_TeamHol.[Holiday End Date], Tbl_Staff.Team2, Tbl_Staff.Team
FROM Tbl_Staff INNER JOIN Qry_TeamHol ON Tbl_Staff.Team = Qry_TeamHol.Team
WHERE (((Year([Holiday Start Date]))=[Forms]![Frm_Menu]![txtYear]) AND ((Tbl_Staff.Team2)=[forms]![Frm_Menu]![TxtTeam]) AND ((Tbl_Staff.Team)=[forms]![Frm_Menu]![TxtTeam]))
ORDER BY Qry_TeamHol.[Holiday Start Date];

i need Tbl_Staff.Team or Tbl_Staff.Team2 to equal [forms]![Frm_Menu]![TxtTeam]) instead of them both having to match, I've tried just replacing the "and" with an "or" but this doesn't work, can anybody help?
 
I think it's probably a bracket issue...

your where condition should look something like:

Code:
WHERE (
   Year(stDt)=[tbx] AND (
      team2=[tbx] [b]OR[/b] team=[tbx]
   )
)

of course, access will strip any white spaces after you save...

Procrastinate Now!
 
Cheers Crowley, that's done the trick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top