Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / March 2008

Tip: Looking for answers? Try searching our database.

Simple criteria question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
miss031 - 08 Mar 2008 07:43 GMT
I am not too good at writing SQL, and I don't know how to do this in design
view:  I would like the results of my query to be equal to ([this] AND
[that]) OR [the_other_thing].  I don't know the correct sytnax - please help!
Allen Browne - 08 Mar 2008 07:59 GMT
Just type your expression (including the brackets) into the Criteria row
under the field that you wish apply the criteria to, i.e.
   ([this] AND [that]) OR [the_other_thing]

I'm not sure I understand your goals here.
There cannot be any value that will meet the criterion:
   ([this] AND [that])
i.e. if it's this, it cannot be that at the same time.
Therefore your criteria will return only records that contain
the_other_thing.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I am not too good at writing SQL, and I don't know how to do this in design
> view:  I would like the results of my query to be equal to ([this] AND
> [that]) OR [the_other_thing].  I don't know the correct sytnax - please
> help!
miss031 - 08 Mar 2008 08:27 GMT
To clarifiy:
I have a multiple table query and I would like to find records that:
match [contact_ID] where [sale_current] = True
OR that match [contact_ID] where [is_perm] = True

> Just type your expression (including the brackets) into the Criteria row
> under the field that you wish apply the criteria to, i.e.
[quoted text clipped - 11 lines]
> > [that]) OR [the_other_thing].  I don't know the correct sytnax - please
> > help!
Allen Browne - 08 Mar 2008 08:34 GMT
Presumably [sale_current] and [is_perm] are Yes/No fields.

In query design, in the Criteria row under [sale_current], enter:
   True

Below the Criteria row is one with OR at the left.
On this row, under [is_perm], enter:
   True

I'm not sure if you want to further restrict the query to only these with a
particular [contact_ID]. If so, enter the number your contract number on
*both* rows under the [Contract_ID] field.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> To clarifiy:
> I have a multiple table query and I would like to find records that:
[quoted text clipped - 17 lines]
>> > [that]) OR [the_other_thing].  I don't know the correct sytnax - please
>> > help!
miss031 - 08 Mar 2008 08:53 GMT
SO exactly what I needed!  Thanks for your quick responses!

> Presumably [sale_current] and [is_perm] are Yes/No fields.
>
[quoted text clipped - 30 lines]
> >> > [that]) OR [the_other_thing].  I don't know the correct sytnax - please
> >> > help!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.