Trying to get a query to return certain records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

IIf([Forms]![search by type]![ip_type] In ("EAR/BAR Core"),Between 0 And 10,0)

I have added the above statement to a query field critieria. I get no
records returned. If I simply put between 0 and 10 I get 11 records
returned as expected. I should get the same 11 records with the first
statement as far as I know. Any ideas?
 
Worked like a champ! Thanks

Ofer said:
Try this

Between 0 and IIf([Forms]![search by type]![ip_type] = "EAR/BAR Core",10,0)

--
I hope that helped
Good luck


jbirchal said:
IIf([Forms]![search by type]![ip_type] In ("EAR/BAR Core"),Between 0 And 10,0)

I have added the above statement to a query field critieria. I get no
records returned. If I simply put between 0 and 10 I get 11 records
returned as expected. I should get the same 11 records with the first
statement as far as I know. Any ideas?
 
What if I need to string multiples together? Like one is between 0 and 128
the next is between 129 and 255.

Ofer said:
Try this

Between 0 and IIf([Forms]![search by type]![ip_type] = "EAR/BAR Core",10,0)

--
I hope that helped
Good luck


jbirchal said:
IIf([Forms]![search by type]![ip_type] In ("EAR/BAR Core"),Between 0 And 10,0)

I have added the above statement to a query field critieria. I get no
records returned. If I simply put between 0 and 10 I get 11 records
returned as expected. I should get the same 11 records with the first
statement as far as I know. Any ideas?
 
It would be


SELECT * FROM TableName
WHERE FieldName Between IIf([Field2Name]="Something",0,129) And
IIf([Field2Name]="Something",128,255)

--
I hope that helped
Good luck


jbirchal said:
What if I need to string multiples together? Like one is between 0 and 128
the next is between 129 and 255.

Ofer said:
Try this

Between 0 and IIf([Forms]![search by type]![ip_type] = "EAR/BAR Core",10,0)

--
I hope that helped
Good luck


jbirchal said:
IIf([Forms]![search by type]![ip_type] In ("EAR/BAR Core"),Between 0 And 10,0)

I have added the above statement to a query field critieria. I get no
records returned. If I simply put between 0 and 10 I get 11 records
returned as expected. I should get the same 11 records with the first
statement as far as I know. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top