Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have two tables, with the same fields in both (I know what you are thinking, but I inherited this from someone else...!). I need to link them as they contain useable data in both tables. For instance SPO2Meas is the field name but I can't work out how to reference this to the first table PE29_AOCResults and not to PE29_AOCScores.
In other words, how can I make it work like table1.fieldname as newfieldname
hope this helps, here is the script.
AOC:LOAD
//SQL SELECT1
PRFUniqueId as %KEY_PRFUID,
SPO2Meas;SQL
SELECT *
//WHERE IncDate >= DateAdd(month,-48,GETDATE())
) prf
ON
aor.PRFUniqueId = prf.PRFUniqueId
inner JOIN
[TCMPRF].[dbo].[PE29_AOCSCores] aos
ON
aos.PRFUniqueId = aor.PRFUniqueId
FROM TCMPRF.dbo."PE29_AOCResults" aor
INNER JOIN
(SELECT PRFUniqueId FROM TCMPRF.dbo."PE29_AOCResults"
where IncDate between '01-Nov-2008' and getdate()
Hi Phil,
You may use:
Qualify *;
or
Unqualify *;
Instead of * you could also specify fields you want to qualify or unqualify. See documentation for these two functions.
Thats not quite what I am after.
In the table AOCResults there is a field with data, named SPO2Meas.
The same field exists in AOCScores.
I need the SQL to only display the data from AOCResults.
Does this help?