Current query is based on a payroll table that has PayPeriod, Posted date, data. I need to show a value for PayPeriod/Posted date in a date range, even if no data exists for that date. This is used to set a column alias for an unbound crosstab report. Date range is always 7 days, running Saturday thru Friday and I need to show the date, even if there is no payroll for that particular date. Am using an unbound crosstab report that will be hard coded for 7 days, but the date value changes according to the current week. Normally, this report is only one week long, but in the winter time, it may cover 2-3 weeks, or more. That is why I am using the 'week' function to get a week number, and can set sorting/grouping on 'week'.
INSERT INTO tblPayAlias ( datPayPeriod, datTicketPost, [Level] )
SELECT tblPayrollCompany.datPayPeriod, tblPayrollCompany.datTicketPost, Format([datTicketPost],"ww",7) AS Week
FROM tblPayrollCompany
GROUP BY tblPayrollCompany.datPayPeriod, tblPayrollCompany.datTicketPost, Format([datTicketPost],"ww",7)
HAVING (((tblPayrollCompany.datPayPeriod)=[Forms]![frmPayroll]![txtPayDate]));
Some dates do not have payroll records. (ie: sunday) Would like to 'force' an entry for the date that has no records.
right now getting:
Pay Date Posted Week
2/13/04 1/19/04 4
2/13/04 1/20/04 4
2/13/04 1/21/04 4
2/13/04 1/22/04 4
2/13/04 1/23/04 4
2/13/04 1/26/04 5
2/13/04 1/27/04 5
2/13/04 1/28/04 5
2/13/04 1/29/04 5
2/13/04 1/30/04 5
2/13/04 1/31/04 6
2/13/04 2/2/04 6
2/13/04 2/3/04 6
2/13/04 2/4/04 6
2/13/04 2/5/04 6
2/13/04 2/6/04 6
need to show entries for 01/24, 01/25, 02/01, etc. I want it to show it in groups of 7 days, based on the 'week' value, even if there is no payroll entry for those particular pay dates. This will be used to make a crosstab report for payroll that looks similar to the following:
driver 01/24 01/25 01/26 01/27 01/28 01/29 01/30 Week 1
Joe 0 0 100 0 0 0 0 100
Tom 100 0 100 100 0 0 0 300
100 0 200 100 0 0 0 400
driver 01/31 02/01 02/02 02/03 02/04 02/05 02/06 Week 2
Joe 0 0 100 0 100 100 0 300
Tom 100 0 100 0 0 0 0 200
100 0 200 0 100 100 0 500
driver SAT SUN MON TUE WED THU FRI TOT PAY
Total 200 0 400 100 100 100 0 1000
Checks issued Week 2
Joe $400
Tom $500
I am generating a crosstab report looking like the above example. There will not be two records on one day for the same driver, but there will be days that have no records for a driver. Normally our pay period runs from Saturday to Friday and we pay weekly. In the winter, If a driver only has one or two days in a payperiod, we 'roll' that payment over to the next week and just issue one check for the multiple weeks, ie: Payroll for Monday in week 1, payroll for Monday, Wednesday and Thursday in week 2, no check issued week 1, check issued in Week 2 has payroll for Monday of first week and Monday, Wednesday and Thursday of second week. I am trying to set up a report that will show the payroll values for the payperiod (ie, 02/13/04) broken down by date (ie: payroll for 01/26 Monday, 02/02 Monday, 02/04 Wednesday and 02/05 Thursday)
driver 01/24 01/25 01/26 01/27 01/28 01/29 01/30 Week 1
Joe 0 0 100 0 0 0 0 100
driver 01/31 02/01 02/02 02/03 02/04 02/05 02/06 Week 2
Joe 0 0 100 0 100 100 0 300
driver SAT SUN MON TUE WED THU FRI TOT PAY
Joe 0 0 200 0 100 100 0 400
Total Check would be $400 in above example, with 4 days on it. I need to show the breakdown of the dates for verification purposes. Problem I am having is that it skips the dates if there is no data for that date..query just shows 01/26, 02/02, 02/04 and 02/05. I need it to show all dates from 01/24 to 02/06 with zero values for the date that has no data. Since this is an unbound crosstab report that has variable headings, I 'have' to have a date heading even for days with no data, or it does not fill my headers correctly <annoyed sound> Have been working on this for almost 2 weeks and it is driving me crazy.
Thanks! Regina
INSERT INTO tblPayAlias ( datPayPeriod, datTicketPost, [Level] )
SELECT tblPayrollCompany.datPayPeriod, tblPayrollCompany.datTicketPost, Format([datTicketPost],"ww",7) AS Week
FROM tblPayrollCompany
GROUP BY tblPayrollCompany.datPayPeriod, tblPayrollCompany.datTicketPost, Format([datTicketPost],"ww",7)
HAVING (((tblPayrollCompany.datPayPeriod)=[Forms]![frmPayroll]![txtPayDate]));
Some dates do not have payroll records. (ie: sunday) Would like to 'force' an entry for the date that has no records.
right now getting:
Pay Date Posted Week
2/13/04 1/19/04 4
2/13/04 1/20/04 4
2/13/04 1/21/04 4
2/13/04 1/22/04 4
2/13/04 1/23/04 4
2/13/04 1/26/04 5
2/13/04 1/27/04 5
2/13/04 1/28/04 5
2/13/04 1/29/04 5
2/13/04 1/30/04 5
2/13/04 1/31/04 6
2/13/04 2/2/04 6
2/13/04 2/3/04 6
2/13/04 2/4/04 6
2/13/04 2/5/04 6
2/13/04 2/6/04 6
need to show entries for 01/24, 01/25, 02/01, etc. I want it to show it in groups of 7 days, based on the 'week' value, even if there is no payroll entry for those particular pay dates. This will be used to make a crosstab report for payroll that looks similar to the following:
driver 01/24 01/25 01/26 01/27 01/28 01/29 01/30 Week 1
Joe 0 0 100 0 0 0 0 100
Tom 100 0 100 100 0 0 0 300
100 0 200 100 0 0 0 400
driver 01/31 02/01 02/02 02/03 02/04 02/05 02/06 Week 2
Joe 0 0 100 0 100 100 0 300
Tom 100 0 100 0 0 0 0 200
100 0 200 0 100 100 0 500
driver SAT SUN MON TUE WED THU FRI TOT PAY
Total 200 0 400 100 100 100 0 1000
Checks issued Week 2
Joe $400
Tom $500
I am generating a crosstab report looking like the above example. There will not be two records on one day for the same driver, but there will be days that have no records for a driver. Normally our pay period runs from Saturday to Friday and we pay weekly. In the winter, If a driver only has one or two days in a payperiod, we 'roll' that payment over to the next week and just issue one check for the multiple weeks, ie: Payroll for Monday in week 1, payroll for Monday, Wednesday and Thursday in week 2, no check issued week 1, check issued in Week 2 has payroll for Monday of first week and Monday, Wednesday and Thursday of second week. I am trying to set up a report that will show the payroll values for the payperiod (ie, 02/13/04) broken down by date (ie: payroll for 01/26 Monday, 02/02 Monday, 02/04 Wednesday and 02/05 Thursday)
driver 01/24 01/25 01/26 01/27 01/28 01/29 01/30 Week 1
Joe 0 0 100 0 0 0 0 100
driver 01/31 02/01 02/02 02/03 02/04 02/05 02/06 Week 2
Joe 0 0 100 0 100 100 0 300
driver SAT SUN MON TUE WED THU FRI TOT PAY
Joe 0 0 200 0 100 100 0 400
Total Check would be $400 in above example, with 4 days on it. I need to show the breakdown of the dates for verification purposes. Problem I am having is that it skips the dates if there is no data for that date..query just shows 01/26, 02/02, 02/04 and 02/05. I need it to show all dates from 01/24 to 02/06 with zero values for the date that has no data. Since this is an unbound crosstab report that has variable headings, I 'have' to have a date heading even for days with no data, or it does not fill my headers correctly <annoyed sound> Have been working on this for almost 2 weeks and it is driving me crazy.
Thanks! Regina