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  

Trying to get a query to return certain records



 
 
Thread Tools Display Modes
  #1  
Old September 7th, 2005, 09:58 PM
jbirchal
external usenet poster
 
Posts: n/a
Default 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  
Old September 7th, 2005, 10:56 PM
Ofer
external usenet poster
 
Posts: n/a
Default

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  
Old September 7th, 2005, 11:03 PM
jbirchal
external usenet poster
 
Posts: n/a
Default

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  
Old September 7th, 2005, 11:17 PM
jbirchal
external usenet poster
 
Posts: n/a
Default

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  
Old September 9th, 2005, 12:41 AM
Ofer
external usenet poster
 
Posts: n/a
Default

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

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

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


All times are GMT +1. The time now is 02:20 PM.


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