A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

WHERE



 
 
Thread Tools Display Modes
  #1  
Old February 27th, 2007, 11:09 PM posted to microsoft.public.access.queries
skr
external usenet poster
 
Posts: 17
Default WHERE

Can somebody please explain how WHERE works and under what circumstances it
should be used? I've found that it works for some of the things I want, but
I would like to know if there is a way to know when to use WHERE.

Thanks
Sue

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...access.queries
  #2  
Old February 27th, 2007, 11:57 PM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default WHERE

Sue

I can't tell from your description, but suspect you are trying to write SQL
statements to work as queries.

In MS Access, you can create queries in design view and not need to focus on
the SQL (unless you wish to).

Regards

Jeff Boyce
Microsoft Office/Access MVP

"skr" wrote in message
...
Can somebody please explain how WHERE works and under what circumstances
it
should be used? I've found that it works for some of the things I want,
but
I would like to know if there is a way to know when to use WHERE.

Thanks
Sue

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow
this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...access.queries



  #3  
Old February 28th, 2007, 12:11 AM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 2,364
Default WHERE

WHERE in a query applies criteria against fields to return records that
match the criteria.

Basically when you don't want ALL the records returned, you use a where
clause.

This starts to get complicated when you use multiple criteria.
You can say that all the criteria must be met
(WHERE A = 1 and B=2)
or you can say that any of the criteria must be met
(WHERE A=1 or B=2)

or you can make it more complicated and combine things
WHERE A=1 AND (B=2 or C=5)
So a record is returnd if A =1 and if B=2 or C=5.

Move the parenthese
WHERE (A=1 AND B=2) or C=5)
and a record is returned if a=1 and b=2 or if C = 5

That very, very lightly scratches the surface of what where does in a
query.

There are multiple operators you can use - equal, not equal, less than,
more than, and like are the more common ones.

'================================================= ===
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'================================================= ===


skr wrote:
Can somebody please explain how WHERE works and under what circumstances it
should be used? I've found that it works for some of the things I want, but
I would like to know if there is a way to know when to use WHERE.

Thanks
Sue

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...access.queries

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:35 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.