Work-Access 97 SR1
Home-Access 2000
Greetings,
Apologizing for the long post. Analyzing Time and Billing. I receive a flat file in Excel every two weeks, which I append to an Access file. A large portion of the analysis is capturing errors between the HourTypeCode and WC5. As of now, I have over 12K records to process.
Example: If HourTypeCode = LS then WC5 must equal GL000007. If WC5 is not GL000007 then it's an error.
I've played with several methods of doing this. First was using a query for every single type of error, then creating a new table called t_Errors, and appending the results of each query into the Errors table. I would then use the Errors table to generate the reports I'm responsible for.
I've also played with IIF statements. Here is an SQL example:
SELECT t_EmplInfo.BUserId, t_EmplInfo.EmplName, t_EmplInfo.PERN, t_EBiz_YTD.ID, t_EBiz_YTD.HourTypeCode, t_EBiz_YTD.HourTypeDescription, t_EBiz_YTD.WC5, t_EBiz_YTD.WC5Desc, IIf([HourTypeCode]="LS" And [WC5]<>"GL000007","HrCd LS/WC5<>GL000007",Null) AS TypeErrors
FROM t_EmplInfo INNER JOIN t_EBiz_YTD ON t_EmplInfo.BUserId = t_EBiz_YTD.BUserId
WHERE (((IIf([HourTypeCode]="LS" And [WC5]<>"GL000007","HrCd LS/WC5<>GL000007",Null)) Is Not Null));
Is it possible for me to use multiple criteria in my IIF statements? As an example, here are three IIFs that are in my query grid which are looking for three distinct errors. LS=SickLeave, LA=AnnualLeave, LN=AdminLeave:
Query1: TypeErrors: IIf([HourTypeCode]="LS" And [WC5]<>"GL000007","HrCd LS/WC5<>GL000007",Null)
Query2: TypeErrors: IIf([HourTypeCode]="LA" And [WC5]<>"GL000002","HrCd LA/WC5<>GL000002",Null)
Query3: TypeErrors: IIf([HourTypeCode]="LN" And [WC5]<>"GL000001","HrCd LN/WC5<>GL000001",Null)
As I've stated, there are about 50 HourTypeCodes I have to evaluate. Alas, WC5 is not the only evaluation that needs to be done. If HourTypeCode = LS (Leave Sick) then WC4 must equal GL000 and WC5 must equal GL000007. I have 31 HourTypeCodes that pertain to Leave, and about 19 that pertain to Work. The crux is that sometimes WC4 = GL000 but WC5 <> GL000007, then other times WC4 <>GL000 and WC5 = GL000007
I'll take whatever advice I can get, but my goal would be to minimize the number of queries I have to run, which I then must append to a new table. One record can in fact have multiple errors on it! So, I created another table called t_EmplInfo, which contains as it's PK the field BUserId. I was hoping that in doing this, I could make it clear to those who make the corrections that One Employee can have multiple errors, and that one record could have multiple errors.
Thanks in advance for any suggestions!! Hope I'm not making this sound too difficult.
Bob in Indy
Home-Access 2000
Greetings,
Apologizing for the long post. Analyzing Time and Billing. I receive a flat file in Excel every two weeks, which I append to an Access file. A large portion of the analysis is capturing errors between the HourTypeCode and WC5. As of now, I have over 12K records to process.
Example: If HourTypeCode = LS then WC5 must equal GL000007. If WC5 is not GL000007 then it's an error.
I've played with several methods of doing this. First was using a query for every single type of error, then creating a new table called t_Errors, and appending the results of each query into the Errors table. I would then use the Errors table to generate the reports I'm responsible for.
I've also played with IIF statements. Here is an SQL example:
SELECT t_EmplInfo.BUserId, t_EmplInfo.EmplName, t_EmplInfo.PERN, t_EBiz_YTD.ID, t_EBiz_YTD.HourTypeCode, t_EBiz_YTD.HourTypeDescription, t_EBiz_YTD.WC5, t_EBiz_YTD.WC5Desc, IIf([HourTypeCode]="LS" And [WC5]<>"GL000007","HrCd LS/WC5<>GL000007",Null) AS TypeErrors
FROM t_EmplInfo INNER JOIN t_EBiz_YTD ON t_EmplInfo.BUserId = t_EBiz_YTD.BUserId
WHERE (((IIf([HourTypeCode]="LS" And [WC5]<>"GL000007","HrCd LS/WC5<>GL000007",Null)) Is Not Null));
Is it possible for me to use multiple criteria in my IIF statements? As an example, here are three IIFs that are in my query grid which are looking for three distinct errors. LS=SickLeave, LA=AnnualLeave, LN=AdminLeave:
Query1: TypeErrors: IIf([HourTypeCode]="LS" And [WC5]<>"GL000007","HrCd LS/WC5<>GL000007",Null)
Query2: TypeErrors: IIf([HourTypeCode]="LA" And [WC5]<>"GL000002","HrCd LA/WC5<>GL000002",Null)
Query3: TypeErrors: IIf([HourTypeCode]="LN" And [WC5]<>"GL000001","HrCd LN/WC5<>GL000001",Null)
As I've stated, there are about 50 HourTypeCodes I have to evaluate. Alas, WC5 is not the only evaluation that needs to be done. If HourTypeCode = LS (Leave Sick) then WC4 must equal GL000 and WC5 must equal GL000007. I have 31 HourTypeCodes that pertain to Leave, and about 19 that pertain to Work. The crux is that sometimes WC4 = GL000 but WC5 <> GL000007, then other times WC4 <>GL000 and WC5 = GL000007
I'll take whatever advice I can get, but my goal would be to minimize the number of queries I have to run, which I then must append to a new table. One record can in fact have multiple errors on it! So, I created another table called t_EmplInfo, which contains as it's PK the field BUserId. I was hoping that in doing this, I could make it clear to those who make the corrections that One Employee can have multiple errors, and that one record could have multiple errors.
Thanks in advance for any suggestions!! Hope I'm not making this sound too difficult.
Bob in Indy