Query Question
Posted: Sat Sep 05, 2020 5:09 pm
In creating queries, I notice that if I want a column with the patient name and I type
Select patnum
the result produces a column titled PatNum with the actual patient names (last name, first name).
But if I want the column to be titled "Patient" instead of "PatNum" and I type
Select patnum as Patient
The result produces a column titled "Patient", but lists the patient ID#s and not names.
Example
SELECT s.PatNum as Patient, sf.FieldValue
FROM Sheet s, SheetField sf
WHERE s.SheetNum=sf.SheetNum
And sf.ReportableName='XYZ'
And SheetDefNum = 100
The query works, but I get Patient ID#'s instead of names.
Select patnum
the result produces a column titled PatNum with the actual patient names (last name, first name).
But if I want the column to be titled "Patient" instead of "PatNum" and I type
Select patnum as Patient
The result produces a column titled "Patient", but lists the patient ID#s and not names.
Example
SELECT s.PatNum as Patient, sf.FieldValue
FROM Sheet s, SheetField sf
WHERE s.SheetNum=sf.SheetNum
And sf.ReportableName='XYZ'
And SheetDefNum = 100
The query works, but I get Patient ID#'s instead of names.