• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

MULTIPLE FILTERS

I have a table and I would like to filter all records that meet a certain criteria.  Can some one take a look at what I have and tell me the best way to do this.  I made 2 querys and I would like them to run at the same time but I do not know how.   I might just completely be going about this the wrong way.  

thankyou
0
-Gil
Asked:
-Gil
  • 13
  • 9
  • 7
  • +1
1 Solution
 
jmoss111Commented:
You would normally attach a file to look at,

regards,

jim
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Jim ... and I thought you were a visionary ?

mx
0
 
jmoss111Commented:
just ask my wife...
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
-GilAuthor Commented:
wow thought i had
EE11111111.mdb
0
 
-GilAuthor Commented:
query one pulls all that have an NA
query 2 pull any that have a  P or F
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
What is wrong with what you have?

You cannot run them exactly at the same time.  

mx
0
 
-GilAuthor Commented:
can I do something else to make it run all at one time?  i created this becasue the idea is similar to  a database im creating(I cant post it).   But I would need to run about 4 querys to get all the records I need.
0
 
jmoss111Commented:
it looks like Joe isn't going to graduate...

like mx said they will have to run serially
0
 
jmoss111Commented:
You could do a join and they would return the results at the same time but since there is no update involved what difference does it make?
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"it looks like Joe isn't going to graduate..."

huh ??

I already have an MSEE !
0
 
jmoss111Commented:
I think that the question needs a bit more substance.
0
 
jmoss111Commented:
His Joe, not you mx
0
 
ragoranCommented:
If the queries returns the same column (too lazy to open the file),  you can Union them...
0
 
-GilAuthor Commented:
Sorry im new to access what do you mean by no update
0
 
jmoss111Commented:
The source data remains the same for both queries so noting would change if they ran serially, or with using a join or a union as ragoran suggests.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Too many Joe's ... Joe Blow, Joe Mama, Hey Joe, Go Joe, Cup of Joe ... dang !!

Gil (Grissom?) ... what exactly are you trying to accomplish.  Keep in mind the JM lives in a DOD town!

mx
0
 
jmoss111Commented:
Update means that neither query changes the source table so the results would be the same if they ran serially
0
 
jmoss111Commented:
mx, keep in mind that my DoD town packs a wallop!
0
 
jmoss111Commented:
Forgive us, Gil... it's Friday
0
 
-GilAuthor Commented:
I see.  Well what you dorecomend I do.  If you wanted to pull all these records at once because these would be the records with mistakes on them and needed tp  correct them.    Should I use a union after all?
0
 
-GilAuthor Commented:
lol yeah I understand usually im gone by know but I woke up late :(
0
 
ragoranCommented:
Make sure but queries are selecting the column in the same sequence (Student, Semester, Math, ...)

Remove the condition on Student from both queries.

Create this new query:

SELECT * from query1
union  
select * from query2
where student = [Type JOE]
0
 
jmoss111Commented:
Union would probably be the best bet.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Man, I don't know about unions ... look at the auto industry!!!

jm ... it's NASCAR weekend here in CA ... you're gonna have to take over ... I will be at the track Sat/Sun.

mx
0
 
jmoss111Commented:
I was thinking about calling in an air strike on Rancho Cucamonga on Sunday, stay low things may get out of hand.
0
 
-GilAuthor Commented:
ragoran,
Can you be a little clearer I know its really simple but I have never done one before.
Thankyou
0
 
ragoranCommented:
1- When creating union, it is simpler to create the basic queries as you did (Query1 and query2).  However, it is best if the queries return the same columns in the same sequence.

So both queries should start with:

SELECT STUDENT, SEMESTER, MATHCLASS, READINGCLASS, SPEACHCLASS, ENGLISHCLASS FROM Table1


2- because you are running the queries together, it is easier to have only one question for the condition (Type JOE), so I removed them from query1 and 2.

3- You can't create a Union query using the query tools, you need to type it in the SQL pane:
   - create a new query in design view
   - close the "Select table" dialog
   - in the View menu, select SQL Mode
   - copy-paste the query above.


0
 
ragoranCommented:
Need to go for an appointment. I will login in 4-5 hours from now.

Jim / mx, don't hesitate to jump back in to help Gil  -- thanks
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Well, jim is kinda busy setting up that air strike!  But Jim ... no need, because usually they have a Stealth fighter fly over just as the SSB ends.  

mx
0
 
jmoss111Commented:
Have a nice weekend at the races mx.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
thx Jim ... and you have a big one down in dod land too!

Hey ... I have to head to a meeting ... finish this off and you get the pts ...

mx
0
 
-GilAuthor Commented:
I did some searching online and saw that "UNION ALL" was used so I used this but I would now like to take away one of the message boxes that ask to "enter joe"   the student name.  I tried deleteing it from the second QUERY but have not got successful results.

-gil
EE222222222.mdb
0
 
-GilAuthor Commented:
thankyou for helping me learn how to make a union
0
 
ragoranCommented:
If you don't want to be asked "Enter Joe", you must remove all conditions on the field Student in Query 4.  Query4 will then return all records that match criteria.

To filter the result, create a new query:

select * from query4 where student="Joe"

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 13
  • 9
  • 7
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now