View Full Version : report Query


dmullins
10-20-2009, 11:39 AM
I have a query that runs fine in datasheet view but when attached to report it bombs.

It has to be related to the expression field I put in to select to proper types from two different tables. (EXP1:)

Hear is the code.

SELECT Count(qryExamErrorsByDate.LicenseNum) AS CountOfLicenseNum, Sum(qryExamErrorsByDate.REFUNDS) AS SumOfREFUNDS, qryExamErrorsByDate.ReportingMonth, IIf(IsNull(dbo_dcd2009Licensees.LicenseType),[dbo_2009ddlcDDL-Licensees2].LicenseType,dbo_dcd2009Licensees.LicenseType) AS expr1
FROM qryExamErrorsByDate
GROUP BY qryExamErrorsByDate.ReportingMonth, qryExamErrorsByDate.[dbo_2009ddlcDDL-Licensees2].LicenseType, qryExamErrorsByDate.dbo_dcd2009Licensees.LicenseTy pe, IIf(IsNull(dbo_dcd2009Licensees.LicenseType),[dbo_2009ddlcDDL-Licensees2].LicenseType,dbo_dcd2009Licensees.LicenseType);

Any help would really be appreciated.

Thanks
http://www.utteraccess.com/forums/images/ua_right_curve.gifPage Jump

wiklendt
10-21-2009, 04:46 AM
but when attached to report it bombs.

how? error messages? what do you see?



Hear is the code.

SELECT Count(qryExamErrorsByDate.LicenseNum) AS CountOfLicenseNum, Sum(qryExamErrorsByDate.REFUNDS) AS SumOfREFUNDS, qryExamErrorsByDate.ReportingMonth, IIf(IsNull(dbo_dcd2009Licensees.LicenseType),[dbo_2009ddlcDDL-Licensees2].LicenseType,dbo_dcd2009Licensees.LicenseType) AS expr1
FROM qryExamErrorsByDate
GROUP BY qryExamErrorsByDate.ReportingMonth, qryExamErrorsByDate.[dbo_2009ddlcDDL-Licensees2].LicenseType, qryExamErrorsByDate.dbo_dcd2009Licensees.LicenseTy pe, IIf(IsNull(dbo_dcd2009Licensees.LicenseType),[dbo_2009ddlcDDL-Licensees2].LicenseType,dbo_dcd2009Licensees.LicenseType);


please paste the code again wrapping with code tags

http://www.access-programmers.co.uk/forums/attachment.php?attachmentid=29287&stc=1&d=1256129162