SQL Query

Sep 23, 2011 at 6:07 PM

Hello,

I'm having a problem of course. I have a table called tests with four columns Labnum,Testname, Result and MicroBio.

when microbio is 0 then the test is a Chemistry test and if the microBio is 1 then the test is a Micro Biology test. I am trying to produce a chemistry list where the Labnum is only produced when all the chemistry tests have a result only eg

Test View

1234(labnum) -Glucose(Testname) - 0.2(Result) -0(MicroBio-Chemistry test)

1234(labnum)-fbc(Testname) -5.3(Result)-0(MicroBio-Chemistry test)

1234(labnum)-Urine(Testname) - yellow(Result)- 1(MicroBio-micro bio test)

so in the list it wont show since fbc is '0' but if fbc was not a '0' then it will show in the labnum. I need to only show one labnum not all the labnum each tests that have a result eg

Labnum(completed Chemistry Tests)

1234

 

Please assist, or even an example

Thank you in advance