I have been shown a rather complex SQL statement. My knowledge of SQL is limited. I am attempting to translate the query to the language used by Business Objects.
This is the SQL statement:
SELECT
count(dbo.VISIT.P_KEY),
datepart(mm,( dbo.VISIT.ARRIVALDT )),
TriageAcuityMstrLst.URGENCY
FROM
dbo.VISIT LEFT OUTER JOIN dbo.ACUITYASSESSMENT TriageAcuityAssessment ON TriageAcuityAssessment.VISIT_FK=dbo.VISIT.P_KEY and TriageAcuityAssessment.Acuity_SVC_FK = '00000000000A2'
LEFT OUTER JOIN dbo.ACUITYMSTRLST TriageAcuityMstrLst ON TriageAcuityMstrLst.P_KEY=TriageAcuityAssessment.ACUITYMSTR_FK
WHERE
( dbo.VISIT.Status_SVC_FK != '00000000001JY' and dbo.VISIT.Status_SVC_FK != '00000000000AQ' )
AND (
( ( dbo.VISIT.ARRIVALDT ) >= @Prompt('Select Beginning Date', 'A',, MONO, FREE) AND ( dbo.VISIT.ARRIVALDT ) <= (@Prompt('Select Ending Date', 'A',, MONO, FREE) + ' 23:59:59') )
)
GROUP BY
datepart(mm,( dbo.VISIT.ARRIVALDT )),
TriageAcuityMstrLst.URGENCY
Questions:
1) On the FROm clause, what does the ON phrase mean? If that is part of record selection, why isn't it on the WHERE clause?
This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.