Code: Select all
SELECT anestheticrecord.AnestheticRecordNum,anestheticrecord.AnestheticDate, patient.PatNum as 'Patient#',patient.LName,patient.FName,
patient.Gender,patient.Birthdate,patient.Address,patient.Address2,patient.City,patient.Zip,patient.HmPhone,patient.WirelessPhone,
anesthmedsgiven.AnesthMedName,anesthmedsgiven.QtyGiven,anesthmedsgiven.QtyWasted
FROM anestheticrecord
LEFT JOIN anesthmedsgiven ON anesthmedsgiven.AnestheticRecordNum = anestheticrecord.AnestheticRecordNum
LEFT JOIN patient ON patient.PatNum = anestheticrecord.PatNum
WHERE DATE_FORMAT(anestheticdate,'%Y-%m-%d') >= '2011-01-01' AND DATE_FORMAT(anestheticdate,'%Y-%m-%d') <= '2011-03-31'
ORDER BY anestheticdate ASC
If you want to pretty up the output, click the 'Export' button in the lower right of the User Query window and save it as a .xls file. Then you can open it in Excel and format it however you like.
If anyone needs any other type of Anesthesia-related queries for their practice, just let me know.