473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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
3 1958
Dan2kx
365 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
8,834 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

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

Similar topics

11
by: tdi | last post by:
Ok, stupid question for the day. I'm reading the interview with Steve Moret and he says: "Once a lot of scripts started going in we knew there was no way we could back out of using Python." I'm...
1
by: Tomas Christiansen | last post by:
Im trying to make a simple TCP socket "relay" or "proxy", but my skills in Python are not high (yet). The only thing it should do, is to open the connection on behalf of the client, and when the...
7
by: John | last post by:
Thanks. I am writing a C++ code on Linux and Sun OS platform. How to make a procedure sleep or delay? Thanks again. "John Carson" <donaldquixote@datafast.net.au> wrote in message...
13
by: José Joye | last post by:
The example at the end make me perplex... Looking at the msdn documentation, the inheritance tree that relates to "delegate" is as follow: Object<--Delegate<--MulticastDelegate. Unless I'm...
37
by: jht5945 | last post by:
For example I wrote a function: function Func() { // do something } we can call it like: var obj = new Func(); // call it as a constructor or var result = Func(); // call it as...
3
by: Steven.Xu | last post by:
hi everybody, i am useing some classes which in System.Xml to deal with xml document. what can i do if the document include "<" or ">"? Thanks.
7
by: GHZ | last post by:
Is this the best way to test every item in a list? def alltrue(f,l): return reduce(bool.__and__,map(f,l)) def onetrue(f,l): return reduce(bool.__or__,map(f,l)) False
6
by: Russ P. | last post by:
I've always appreciated Python's lack of requirement for a semi-colon at the end of each line. I also appreciate its rules for automatic line continuation. If a statement ends with a "+", for...
2
by: =?Utf-8?B?QnJlbnQgUm9nZXJz?= | last post by:
I have a asp page that does a Respnse.Redirect() and sometimes I keep getting a "Cannot find server or DNS Error" . I have validated that the URL being redirected to is valid. The URL...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.