Query Formula help please

J

Johnathon Anderson

I hope someone can point out my error.

If [Equipment] = "Shoes Only"
or
If [Equipment] = "Not Required"

and (if either of the 2 above are true)

If [ShoeSize] = Null

then
"Please supply your child's shoes size"

This does not work

NoShoeSize: IIf([Equipment] Not Like "Shoes Only" Or [Equipment] Not Like
"Not Required" And [ShoesSize] Is Null,"Please supply your child's shoes
size")

I have tried many variations but can't get it to work

Thank you

Johnathon
 
J

Johnathon Anderson

Sorry I made a mistake in my question
___________________

I hope someone can point out my error.

If [Equipment] is Not = "School Shoes Only"
or
If [Equipment] is not = "Not Required"

and (if either of the 2 above are true)

If [ShoeSize] = Null

then
"Please supply your child's shoes size"

This does not work

NoShoeSize: IIf([Equipment] Not Like "School Shoes Only" Or [Equipment] Not
Like
"Not Required" And [ShoesSize] Is Null,"Please supply your child's shoes
size")

I have tried many variations but can't get it to work
 
A

Arvin Meyer [MVP]

Supplying the shoe size will always return an empty record because you've
also told it that the shoe size is null. The following query will return
record which fit your requirements of a null shoe size:

SELECT Equipment, ShoeSize
FROM tblTest
WHERE (((Equipment)<>"School Shoes Only") AND ((ShoeSize) Is Null)) OR
(((Equipment)<>"Not Required") AND ((ShoeSize) Is Null));
 
J

Johnathon Anderson

Thank you very much for your help



Arvin Meyer said:
Supplying the shoe size will always return an empty record because you've
also told it that the shoe size is null. The following query will return
record which fit your requirements of a null shoe size:

SELECT Equipment, ShoeSize
FROM tblTest
WHERE (((Equipment)<>"School Shoes Only") AND ((ShoeSize) Is Null)) OR
(((Equipment)<>"Not Required") AND ((ShoeSize) Is Null));
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Johnathon Anderson said:
Sorry I made a mistake in my question
___________________

I hope someone can point out my error.

If [Equipment] is Not = "School Shoes Only"
or
If [Equipment] is not = "Not Required"

and (if either of the 2 above are true)

If [ShoeSize] = Null

then
"Please supply your child's shoes size"

This does not work

NoShoeSize: IIf([Equipment] Not Like "School Shoes Only" Or [Equipment]
Not
Like
"Not Required" And [ShoesSize] Is Null,"Please supply your child's shoes
size")

I have tried many variations but can't get it to work
 
Top