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  

Help with query. Must have D and have either E>=2000 OR etc.



 
 
Thread Tools Display Modes
  #1  
Old May 26th, 2004, 03:11 PM
Sandy
external usenet poster
 
Posts: n/a
Default Help with query. Must have D and have either E>=2000 OR etc.

Hello:

I'm having trouble with a query wherein I need e.g., all rows returned that are not null in Col D AND have either E=2000 OR F=1 OR G=1 OR H=1. I keep getting results back with Nulls in Col D.

Not liking the "SQL" in Access . . . Sql Server is more straightforward . . .

Any help will be appreciated!

Sandy
  #2  
Old May 26th, 2004, 03:44 PM
Rick B
external usenet poster
 
Posts: n/a
Default Help with query. Must have D and have either E>=2000 OR etc.

If you are in the query design window...

under colD put Not Null
Under Col E put =2000

On the next line (or) put...

under colD put Not Null
under ColF put 1

On the next line (OR)

under colD put not null
under G put 1

etc.


You probably only have the 'not null' on one line.

Rick B




"Sandy" wrote in message
...
Hello:

I'm having trouble with a query wherein I need e.g., all rows returned that
are not null in Col D AND have either E=2000 OR F=1 OR G=1 OR H=1. I keep
getting results back with Nulls in Col D.

Not liking the "SQL" in Access . . . Sql Server is more straightforward . .
..

Any help will be appreciated!

Sandy


  #3  
Old May 26th, 2004, 03:46 PM
Ken Snell
external usenet poster
 
Posts: n/a
Default Help with query. Must have D and have either E>=2000 OR etc.

SELECT * FROM TableName
WHERE [Col D] Is Not Null AND
([Col E] = 2000 OR [Col F] = 1
OR [Col G] = 1 OR [Col H] = 1);

--
Ken Snell
MS ACCESS MVP

"Sandy" wrote in message
...
Hello:

I'm having trouble with a query wherein I need e.g., all rows returned

that are not null in Col D AND have either E=2000 OR F=1 OR G=1 OR H=1. I
keep getting results back with Nulls in Col D.

Not liking the "SQL" in Access . . . Sql Server is more straightforward .

.. .

Any help will be appreciated!

Sandy



  #4  
Old May 26th, 2004, 03:47 PM
Duane Hookom
external usenet poster
 
Posts: n/a
Default Help with query. Must have D and have either E>=2000 OR etc.

You can go to the SQL view of your query and type in or modify the query as
you would in the SQL Query Analyzer.

--
Duane Hookom
MS Access MVP
--

"Sandy" wrote in message
...
Hello:

I'm having trouble with a query wherein I need e.g., all rows returned

that are not null in Col D AND have either E=2000 OR F=1 OR G=1 OR H=1. I
keep getting results back with Nulls in Col D.

Not liking the "SQL" in Access . . . Sql Server is more straightforward .

.. .

Any help will be appreciated!

Sandy



  #5  
Old May 27th, 2004, 02:36 PM
Sandy
external usenet poster
 
Posts: n/a
Default Help with query. Must have D and have either E>=2000 OR etc.

Rick -

Thank you very much!

Sandy
  #6  
Old May 27th, 2004, 02:41 PM
Sandy
external usenet poster
 
Posts: n/a
Default Help with query. Must have D and have either E>=2000 OR etc.

Duane -

Thanks for your response!

Sandy
  #7  
Old May 27th, 2004, 02:41 PM
Sandy
external usenet poster
 
Posts: n/a
Default Help with query. Must have D and have either E>=2000 OR etc.

Thanks, Ken.

Access was throwing in so many parentheses, it got confusing. I knew it had to be simpler than Access was making it!

Sandy
 




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 01:28 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.