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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Trying to get a query to return certain records
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? |
#2
|
|||
|
|||
Try this
Between 0 and IIf([Forms]![search by type]![ip_type] = "EAR/BAR Core",10,0) -- I hope that helped Good luck "jbirchal" wrote: 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? |
#3
|
|||
|
|||
Worked like a champ! Thanks
"Ofer" wrote: Try this Between 0 and IIf([Forms]![search by type]![ip_type] = "EAR/BAR Core",10,0) -- I hope that helped Good luck "jbirchal" wrote: 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? |
#4
|
|||
|
|||
What if I need to string multiples together? Like one is between 0 and 128
the next is between 129 and 255. "Ofer" wrote: Try this Between 0 and IIf([Forms]![search by type]![ip_type] = "EAR/BAR Core",10,0) -- I hope that helped Good luck "jbirchal" wrote: 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? |
#5
|
|||
|
|||
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" wrote: What if I need to string multiples together? Like one is between 0 and 128 the next is between 129 and 255. "Ofer" wrote: Try this Between 0 and IIf([Forms]![search by type]![ip_type] = "EAR/BAR Core",10,0) -- I hope that helped Good luck "jbirchal" wrote: 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? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Toolbars, Drop-Down Menus | Rick | New Users | 1 | September 21st, 2005 11:17 AM |
Return all records in a parameter query | Alex | Running & Setting Up Queries | 2 | August 28th, 2005 02:17 PM |
SQL query showing diff between actual and budget | Bon | Running & Setting Up Queries | 3 | August 25th, 2005 12:07 PM |
How do I get the sum from a column and display the sum? | jon | General Discussion | 9 | March 11th, 2005 05:22 PM |
Show records from query 1 or query 2 depending | Running & Setting Up Queries | 1 | September 10th, 2004 12:35 AM |