Setting specific criteria

vX987

Registered User.
Local time
Yesterday, 18:21
Joined
Jun 29, 2007
Messages
51
Hello! I would like to query some data of patients that have TWO certain diagnosis. I only need the ones that have those TWO diagnosis and NOT also the ones that may have one or the other. How would I do this? Do I put "Diagnosis1 And Diagnosis2" in the criteria section? I tried that and it didn't work. Help please??

Thanks in advance!
 
I think that we may need to see how your data is organised.

Brian
 
SELECT PATIENT_NAME
FROM yourtable
WHERE DIAGNOSIS1="TUMOR" AND DIAGNOSIS2="LUPUS"

Is that what you're trying to get?
 
I got the impression that he had tried that hence my request for his data org.

Brian

Maybe he has a new record per diagnosis in which case he will need to select the table twice, join on patient id, select diagnosis from both tables with the AND condition in the criteria
 
Thanks for your reply Brian.

umm, well there is a separate table for patientinfo and another one titled ptdiagnosis because a patient can have more than one diagnosis.

I'm just using the simple "query by design" and i just need to view all patients who have BOTH diagnosis1 and diagnosis2 PLUS their lab results.

Of course, I can query all patients with diagnosis1 AND THEN all patients with diagnosis2 .... THEN copy and paste it onto one spreadsheet and manually REMOVE those patients that do NOT appear twice (because if they appear twice then that means they have both diagnosis) but this would take too much time for I have about 300 patients.

VX
 
Brian, OK it worked by trying what you suggested in your last message .. but weirdly .. I am missing one patient and I checked that pt. and he fulfills both diagnosis1 and diagnosis2, but does not show up with the other patients .... hmmm

I'll try to see what the problem is.

THANK YOU!!!!
 
When looking for text it can be a simple typo in the field, a leading blank is the most difficult to spot which is why Trim is frequently used if the input data is not selected from a list.

Brian
 
I got the impression that he had tried that hence my request for his data org.

Brian

Maybe he has a new record per diagnosis in which case he will need to select the table twice, join on patient id, select diagnosis from both tables with the AND condition in the criteria

I wasn't sure myself. I was replying at the same time as you - didn't mean to step over your reply.
I figured I'd offer something up and see what he came back with. Maybe he's looking for those records where diagnosis1=diagnosis2?
 
Its no problem Red, I just wondered if I'd misread it. He has the answer now so everything is fine and dandy.

Brian
 
English expression , sorry guys but just helping rich and Col with your education. :D

Brian
 
As in yankee doodle dandy? :) Was that an American or British ditty?
 
Geeze, you're in a snooty mood today. Sorry I ask. :(
 
Yankee Doodle Dandy is a 1942 biographical film about George M. Cohan


Brian

Think we should retire to the Watercooler before Bob bars us.
 

Users who are viewing this thread

Back
Top Bottom