467,908 Members | 1,817 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,908 developers. It's quick & easy.

Combine an "AND" and "OR" satement in vba query.

I have a a statement as follows:
Expand|Select|Wrap|Line Numbers
  1. sSQL = "SELECT * FROM QueryCases WHERE Weekday(QueryCases.StartDate) = 1 OR Weekday(QueryCases.StartDate) = 7 ORDER BY QueryCases.StartDate;"
I would like to add an "AND" criteria of "WHERE QueryCases.Completed = False"

How do i combine the two?
Dec 13 '07 #1
  • viewed: 1757
Share:
3 Replies
100+
Expand|Select|Wrap|Line Numbers
  1. sSQL = "SELECT * FROM QueryCases WHERE Weekday(QueryCases.StartDate) = 1 OR Weekday(QueryCases.StartDate) = 7 AND QueryCases.Completed = False ORDER BY QueryCases.StartDate;"
jst a guess
Dec 13 '07 #2
ADezii
Expert 8TB
I have a a statement as follows:

sSQL = "SELECT * FROM QueryCases WHERE Weekday(QueryCases.StartDate) = 1 OR Weekday(QueryCases.StartDate) = 7 ORDER BY QueryCases.StartDate;"

I would like to add an "AND" criteria of "WHERE QueryCases.Completed = False"

How do i combine the two?
Expand|Select|Wrap|Line Numbers
  1. sSQL = "SELECT * FROM QueryCases WHERE 
  2. Weekday(QueryCases.StartDate) In ("1","7") AND QueryCases.Completed = False ORDER BY QueryCases.StartDate;"
Dec 14 '07 #3
Worked like a charm. Thanks
Dec 14 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Tomas Christiansen | last post: by
7 posts views Thread by John | last post: by
13 posts views Thread by Josť Joye | last post: by
7 posts views Thread by GHZ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.