Unanswered: SQL code not selecting properly *** IGNORE THIS a mistake
I get results from the above code, but where the record comes from BOTH ActivePatient AND InPatientList there are blanks in the record where there should be information.
Max(Active) as Active,
Max(Name) as Name,
Max(Type) as Type,
Max(Sex) as Sex,
Max(Age) as Age,
Max(Attending) as Attending,
Max(Location) as Location,
Max(AdmDate) as AdmDate,
Max(LOS) as Los,
Max(Service) as Service
(Select * from vwNET_InPatientList
Select * from vwNET_ActiveList Where Active='JTALLAJ')
Group by HospitalID
ActiveList is initialized to ' ' (a space, not a '') so I thought that Max would pull the information.
above is the ActiveList.
Select Person.PersonID as HospitalID,
DateDiff(year,person.BirthDate,GetDate()) as Age,
' ' As Attending,
' ' As Location,
' ' As AdmDate,
' ' AS LOS,
' ' As Service,
PtList.ProviderCode as Active FROM Person
Inner JOIN PTList ON Person.PersonID = PtList.PersonID
What stupid thing am I doing?
Last edited by DerFarm; 04-09-03 at 11:00.
It IS as bad as you think
and they ARE out to get you