By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 1,987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

Combine 2 Where conditions to form a Third in SQL

P: n/a
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([InterventionDateTime],"Short Date")

Yes, I struggle at building SQL. Thanks in advance.
Aug 5 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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([InterventionDateTime],"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 discussion thread is closed

Replies have been disabled for this discussion.