Trouble with my SQL in GAGEpack

cpascual

New member
Local time
Today, 10:00
Joined
May 19, 2011
Messages
3
This report writing software, GAGEpack, is syntactically correct according to the SQL standard for Microsoft Access. This software doesn't really give error messages so I have no indication of what is actually wrong with the report. The bolded statements is where I am having issues. I don't know if I can have SELECT statements within an IIF statement or not? And also I don't know if I can have that second highlighted LEFT JOIN statement because it uses the Events.EventID that is also used in the previous LEFT JOIN statement? Any advice about possible commands I can use would be appreciated. Thank you

Col1=Date|7
Col2=Event|9
Col3=Result|6
Col4=Was Late|8
Col5=Entered By|14
Col6=Done By|14
Col7=Comments|42
SQL1=SELECT Format(EventDate, "Short Date"), IIF(Type=23, 'Calibration', EventType.Name),
SQL2=IIF(EventType=23, IIF(CalibPassFail=-1, 'Pass', 'Fail'), IIF(EventType=0, IIF(CalibPassFail=-1, 'Pass', 'Fail'), 'N/A')),
SQL3=Format(WasLate, "\N\o;\Y\e\s"), DoneBy, IIF(EventType=0, CalibDoneBy, IIF(EventType=25, MaintDoneBy,
SQL4=IIF(EventType=23, (SELECT VendorName FROM (Events LEFT JOIN EventCalib ON EventCalib.EventID=Events.EventID) LEFT JOIN
SQL5=Vendor ON Vendor.VendorID=EventCalib.CalibVendorID WHERE Events.GageId=$1), (SELECT VendorName FROM (Events LEFT JOIN
SQL6=EventRepair ON EventRepair.EventID=Events.EventID) LEFT JOIN Vendor ON Vendor.VendorID=EventRepair.RepairVendorID WHERE
SQL7=Events.GageId=$1)))),
Events.Comment, GageNumber
SQL8=FROM ((Gages LEFT JOIN Events ON Gages.GageId=Events.GageId)
SQL9=LEFT JOIN EventType ON (Events.EventType=EventType.Type))
SQL10=LEFT JOIN EventCalib ON (EventCalib.EventID=Events.EventID)
SQL11=LEFT JOIN EventMaint ON (EventMaint.EventID=Events.EventID)
SQL12=WHERE (GageNumber >= '%1' AND GageNumber <= '%2') AND Events.GageId=$1 ORDER BY GageNumber, EventDate
 

Users who are viewing this thread

Back
Top Bottom