Hello all,
I've got below expression in a query...
The results for the first part (Pending & Pending - Late) work fine, the rest results in a #Error.
All fields are formatted as Short Date in QRY_Gross_Performance_2. If I put Cdate() around the fields, the expression works fine.
In both instances however I then get an data type mismatch if I use <>"Pending" as criteria. This is strange to me as the expression result is text...
Two questions...
- What goes wrong in the second part of the expression?
- Why can't I use text criteria on the results of the expression?
I've got below expression in a query...
Code:
Gross Document Performance: IIf([QRY_Gross_Performance_Document_2]![Document Upload Date] Is Null And [QRY_Gross_Performance_Document_2]![Target Date]>=Date();"Pending";IIf([QRY_Gross_Performance_Document_2]![Document Upload Date] Is Null And [QRY_Gross_Performance_Document_2]![Target Date]<Date();"Pending - Late";IIf([QRY_Gross_Performance_Document_2]![Document Upload Date]<=[QRY_Gross_Performance_Document_2]![Target Date];"On Time";IIf([QRY_Gross_Performance_Document_2]![Document Upload Date]>[QRY_Gross_Performance_Document_2]![Target Date];"Late"))))
The results for the first part (Pending & Pending - Late) work fine, the rest results in a #Error.
All fields are formatted as Short Date in QRY_Gross_Performance_2. If I put Cdate() around the fields, the expression works fine.
In both instances however I then get an data type mismatch if I use <>"Pending" as criteria. This is strange to me as the expression result is text...
Two questions...
- What goes wrong in the second part of the expression?
- Why can't I use text criteria on the results of the expression?