473,795 Members | 2,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

52 New Member
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.Comp leted = False"

How do i combine the two?
Dec 13 '07 #1
3 1977
Dan2kx
365 Contributor
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 Recognized Expert Expert
I have a a statement as follows:

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

I would like to add an "AND" criteria of "WHERE QueryCases.Comp leted = 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
darnnnel
52 New Member
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
2337
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 just getting into Python and am wondering if I'm missing something or this is just a semantic issue. Thanks. -Ted
1
9095
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 client closes the connection, it should do so too. It's going to "relay" PCL and/or PostScript printjobs to a TCP/IP printer. Does anyone have some sugggestions on code-examples? I've tried googling around, but couldn'r find anythin usefull.
7
947
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 news:<40455261$1@usenet.per.paradox.net.au>... > "John Carson" <donaldquixote@datafast.net.au> wrote in message > news:40455214$1@usenet.per.paradox.net.au
13
3021
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 blind, there is no "+" operator as well for this class. To be able to combine delegates, I thought we should use either MulticastDelegate or event.
37
3993
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 a function
3
2183
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
1901
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
1981
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 example, Python recognizes that the statement obviously must continue. I've noticed, however, that the same rule does not apply when a line ends with "and," "or," or "not." Yes, it's a minor point, but shouldn't the same rule apply? Seems like it...
2
4483
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 including the query sttring is about 370 charcters long. The server is a Virtual Machine running Windows Server 2003. Anyone know what could cause this problem. ?
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10213
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.