Hi, I am working in the following query but need to find a way to convert the fields [FiscalEndMM] and [FiscalYear] from the text data types that they are, to a number data type so my query will work.
I believe it might be the CAST function that gets used, but not sure how...
SELECT dbo_localUnitAudit.CountyCd, dbo_localUnitAudit.LocalUnitType, dbo_localUnitAudit.LocalUnitCd, dbo_localUnitAudit.FiscalYear, dbo_localUnitAudit.Type, dbo_localUnitAudit.Extension, dbo_localUnitAudit.BiAnnual, dbo_localUnitAudit.AuditReceivedDate, dbo_localUnitAudit.Auditor, dbo_localUnitAudit.Notes, dbo_localUnitAudit.AuditLocation, dbo_LocalUnit.FiscalEndMM, Format(DateSerial([FiscalYear],[FiscalEndMM]+6,0),'mm/dd/yyyy') AS AuditDue, IIf([AuditReceivedDate]>[AuditDue],'LATE',IIf([AuditReceivedDate]<[AuditDue],'TIMELY',IIf([auditdue]<Date() And [auditreceiveddate] Is Null,"NOT YET DUE"))) AS FiledTimely, dbo_localUnitAudit.BiAnnual
FROM dbo_LocalUnit INNER JOIN dbo_localUnitAudit ON (dbo_LocalUnit.LocalUnitCd = dbo_localUnitAudit.LocalUnitCd) AND (dbo_LocalUnit.LocalUnitType = dbo_localUnitAudit.LocalUnitType) AND (dbo_LocalUnit.CountyCd = dbo_localUnitAudit.CountyCd)
WHERE (((dbo_localUnitAudit.FiscalYear) Like "*2006"));
I believe it might be the CAST function that gets used, but not sure how...
SELECT dbo_localUnitAudit.CountyCd, dbo_localUnitAudit.LocalUnitType, dbo_localUnitAudit.LocalUnitCd, dbo_localUnitAudit.FiscalYear, dbo_localUnitAudit.Type, dbo_localUnitAudit.Extension, dbo_localUnitAudit.BiAnnual, dbo_localUnitAudit.AuditReceivedDate, dbo_localUnitAudit.Auditor, dbo_localUnitAudit.Notes, dbo_localUnitAudit.AuditLocation, dbo_LocalUnit.FiscalEndMM, Format(DateSerial([FiscalYear],[FiscalEndMM]+6,0),'mm/dd/yyyy') AS AuditDue, IIf([AuditReceivedDate]>[AuditDue],'LATE',IIf([AuditReceivedDate]<[AuditDue],'TIMELY',IIf([auditdue]<Date() And [auditreceiveddate] Is Null,"NOT YET DUE"))) AS FiledTimely, dbo_localUnitAudit.BiAnnual
FROM dbo_LocalUnit INNER JOIN dbo_localUnitAudit ON (dbo_LocalUnit.LocalUnitCd = dbo_localUnitAudit.LocalUnitCd) AND (dbo_LocalUnit.LocalUnitType = dbo_localUnitAudit.LocalUnitType) AND (dbo_LocalUnit.CountyCd = dbo_localUnitAudit.CountyCd)
WHERE (((dbo_localUnitAudit.FiscalYear) Like "*2006"));