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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

What does this Mean?????



 
 
Thread Tools Display Modes
  #1  
Old January 29th, 2009, 04:20 PM posted to microsoft.public.access.gettingstarted
[email protected]
external usenet poster
 
Posts: 45
Default What does this Mean?????

What does 5 or 7 mean?
  #2  
Old January 29th, 2009, 05:03 PM posted to microsoft.public.access.gettingstarted
Roger Carlson
external usenet poster
 
Posts: 824
Default What does this Mean?????

In the Criteria of a query, it means you field does not equal 5 or it DOES
equal 7. This will basically return every value except 5, so the "or" does
nothing.

What do you want it to mean?


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L



wrote in message
...
What does 5 or 7 mean?



  #3  
Old January 29th, 2009, 05:13 PM posted to microsoft.public.access.gettingstarted
[email protected]
external usenet poster
 
Posts: 45
Default What does this Mean?????

I was looking at query someone else wrote and was trying to figure out
what was going on.

Thanks


On Jan 29, 12:03*pm, "Roger Carlson"
wrote:
In the Criteria of a query, it means you field does not equal 5 or it DOES
equal 7. *This will basically return every value except 5, so the "or" does
nothing.

What do you want it to mean?

--
--Roger Carlson
* MS Access MVP
* Access Database Samples:www.rogersaccesslibrary.com
* Want answers to your Access questions in your Email?
* Free subscription:
*http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

wrote in message

...



What does 5 or 7 *mean?- Hide quoted text -


- Show quot

  #4  
Old January 29th, 2009, 05:16 PM posted to microsoft.public.access.gettingstarted
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default What does this Mean?????

As Roger says it should be "and" not "or"

SELECT TableName.YourNumberField
FROM TableName
WHERE (((TableName.YourNumberField)5 And (TableName.YourNumberField)=7));

But as you as saying Not = 5 and = 7 all you will get is 7

So, even when typed correctly, it still should just be 7 (forget the 5) or
foget the 7



--
Wayne
Trentino, Italia.



"Roger Carlson" wrote:

In the Criteria of a query, it means you field does not equal 5 or it DOES
equal 7. This will basically return every value except 5, so the "or" does
nothing.

What do you want it to mean?


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L



wrote in message
...
What does 5 or 7 mean?




  #5  
Old January 29th, 2009, 07:05 PM posted to microsoft.public.access.gettingstarted
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default What does this Mean?????

Its difficult to know just what the original developer had in mind with this
criterion. AND and OR are Boolean logical operators. AND means both
conditions must be True for the expression as a whole to be True, OR means
either one can be True for the expression as a whole to be True.

As written the expression 5 or 7, if in the criteria row of a column
MyField in a query in design view, would be the same as the following
statement:

WHERE MyField 5 OR MyField = 7

This question would be asked of every row and if True the row is returned.
The first part will be True for any row where MyField does not equal 5, i.e.
every row apart from those where MyField = 5. The second part will be True
for those rows where MyField equals 7. But as an OR operator is used here
any row where MyField = 7 will already be returned because it doesn't equal
5, so the first part of the expression is already True. As an OR operation
requires only one part to be True then the second part of the expression is
doing nothing.

If the developer meant that only rows where MyField was equal to neither 5
or 7, i.e. all rows bar those with one of those values in MyField then
another Boolean operator can be brought into p[lay, the NOT operator, which
as you'd expect negatives the expression so it would be:

WHERE NOT(Myfield= 5 OR MyField = 7)

in query d4sign vie this can be entered in the criteria row of MyField as:

Not(5 Or 7)

As rule of thumb think of OR operations being used on one column; to return
rows with either value. Think of AND operations being used on combinations
of columns; to return rows with a value in each, e.g. all employees in London
with salaries greater than 30,000 GBP:

WHERE City = "London" AND Salary 30000

In query design view you'd do this by putting "London" in the first criteria
row of the City column and 30000 in the criteria row of the Salary column.

To return all employees in London or Manchester regardless of salary would be:

WHERE City = "London" OR City = "Manchester"

In query design row you'd put each city name on separate criteria rows of
the city column. Note that in everyday English we might well say "all
employees in London and Manchester" when meaning the above. Boolean logic
however requires an OR.

If we wanted to combine the two the expression would be:

WHERE (City = "London" OR City = "Manchester") AND Salary 30000

Note that the OR operation is included in parentheses here to force it to
evaluate independently of the AND operation. In query design view the city
names would again be entered on separate criteria rows of the city column,
but in this case 30000 would have to be entered twice, on two separate
criteria rows of the Salary column, each alongside one of the criteria on the
City column.

Ken Sheridan
Stafford, England

" wrote:

I was looking at query someone else wrote and was trying to figure out
what was going on.

Thanks


On Jan 29, 12:03 pm, "Roger Carlson"
wrote:
In the Criteria of a query, it means you field does not equal 5 or it DOES
equal 7. This will basically return every value except 5, so the "or" does
nothing.

What do you want it to mean?

--
--Roger Carlson
MS Access MVP
Access Database Samples:www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L

wrote in message

...



What does 5 or 7 mean?- Hide quoted text -


- Show quot



  #6  
Old January 29th, 2009, 10:49 PM posted to microsoft.public.access.gettingstarted
troy23
external usenet poster
 
Posts: 55
Default What does this Mean?????

not equal to 5 or does equal 7

Seems strange criteria


For FREE Access ebook and videos click here
http://access-databases.com/ebook




On 29 Jan, 16:20, wrote:
What does 5 or 7 *mean?


  #7  
Old January 30th, 2009, 08:25 AM posted to microsoft.public.access.gettingstarted
AccessVandal via AccessMonster.com
external usenet poster
 
Posts: 461
Default What does this Mean?????

But than I would read it as

If Control 5 Or Control 7 Then
'do something
else

wrote:
What does 5 or 7 mean?


--
Please Rate the posting if helps you.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/200901/1

 




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 09:53 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.