473,657 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combine 2 Where conditions to form a Third in SQL

Hi - I'm trying to make a Where statement but can't. I''ve put
multiple yes/no fields in a listbox as a field list according Don
Leverton's comments in the thread "query by field heading options" at
http://groups.google.com/group/comp....s-access?hl=en. This
works, and outputs all records that have yes marked in the selected
fields.

Prior to this, I had narrowed report results using starting and ending
dates, txtStartDate and txtEndDate, selected in a form, as described
by Allen Browne at http://www.allenbrowne.com/casu-08.html.

Now, I want to put the 2 together, but get sytax error 3075, '(SELECT
Interventions.* FROM Interventions WHERE ('(All)'=True); txtDatePart
Between #07/28/2008# And #08/05/2008#)'

where txtDatePart is a dummy field in a query that
= :Format([InterventionDat eTime],"Short Date")

Yes, I struggle at building SQL. Thanks in advance.
Aug 5 '08 #1
1 1591
On Tue, 5 Aug 2008 14:03:09 -0700 (PDT), 6a************* **@gmail.com wrote:
>Hi - I'm trying to make a Where statement but can't. I''ve put
multiple yes/no fields in a listbox as a field list according Don
Leverton's comments in the thread "query by field heading options" at
http://groups.google.com/group/comp....s-access?hl=en. This
works, and outputs all records that have yes marked in the selected
fields.

Prior to this, I had narrowed report results using starting and ending
dates, txtStartDate and txtEndDate, selected in a form, as described
by Allen Browne at http://www.allenbrowne.com/casu-08.html.

Now, I want to put the 2 together, but get sytax error 3075, '(SELECT
Interventions. * FROM Interventions WHERE ('(All)'=True); txtDatePart
where txtDatePart is a dummy field in a query that
= :Format([InterventionDat eTime],"Short Date")

Yes, I struggle at building SQL. Thanks in advance.
Assuming that your report is based on a query, open the query in design mode.
Make sure the criteria for all the yes/no fields are what you want. They may
be referenced from a text box on a form. Then in the same criteria row as the
criteria for yes/no fields enter in the txtDatePart field: Between #07/28/2008#
And #08/05/2008#. Switch from Design View to SQL View and examine the code.

My guess is that the semi colon after WHERE ('(All)'=True); should be replaced
with AND along with some bracketing.

Chuck
Aug 5 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5315
by: Henro V | last post by:
Can I integrate 3 existing forms (all based on the same query) integrate in one form by using Tab's? Thanx for thinking, Henro
24
8150
by: trint | last post by:
add them into one PrintDocument: PrintDocument pd1 = new PrintDocument(); PrintDocument pd2 = new PrintDocument(); PrintDocument pdCombined = new PrintDocument(); pdCombined = pd1 + pd2; pdCombined.Print(); Thanks, Trint
1
5846
by: William Stacey [MVP] | last post by:
I need a bullet proof way to combine a root and a relative path to form a FQ rooted path (similar to a VDir in IIS). Path.Combine alone will not do the job in all cases. I also need to be sure the no funny business can go on in the passed "path" that would produce a path not in the root (i.e. "..\..\dir1"). Here is my first stab at it, but not sure if this is too much or not enouph to ensure this. Any thoughts are welcome. TIA. ///...
0
1101
by: nzpcmad | last post by:
I am using C# / .NET / Visual Studio 2003 with Webservices. The application runs on Windows XP. (Note: My connection to the server is via GPRS). All works fine. However, when I packet sniff the line I notice that the HTTP POST header and body are two separate messages.
5
3454
by: Simon Verona | last post by:
I have an installer project for my VB.net application which as a custom action runs a silent installation of a third party software product. This however, generates an error if the application is already installed. I therefore want to check if the application is already installed before launching the setup.exe to install it. I know I use the "condition" property on the custom action - but what exactly do I put in as a condition if I...
2
1778
by: Sal | last post by:
Sorry for the vague subject, not sure how to properly sum up what I need to do. I have 2 tables Tbl1 is single field: CODE 2115-GOR
1
1539
by: shinyo21 | last post by:
Hie, do anyone know the best way to combine all command button by clicking one button instead one by one? Example , I have one command button for the use of calculate total table A. Second button for extracting data from table A to table B. Third button matching table B with table C. I understand all this process actually can be done just by adding it into one button procedurec. But previously I had not consider about flexibility of the user....
1
2867
by: murthychvrm | last post by:
i wrote the stored procedure like as below .it was executed successfully.now i want to write if conditions for this stored procedure at check all conditions if i give fromdate and todate this is first case.second is not give fromdate and give todate.third give fromdate and not give todate.if i not give fromdate and not give todate. how to write code for above cases? stored procedure: set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go alter...
36
3825
by: stateemk | last post by:
I have a db with a table that has many columns of info for various entities. In this table, there are three columns called, entity name, second entity name and third entity name. I need to combine all three columns into one drop box so a search can be done. Once the correct entity name is found, I need to be able to select it and bring up a form with all the data for that entity. For example, say there is an entity that has a name change so...
0
8330
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
8850
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8626
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...
1
6178
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
4175
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
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.