 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 16th, 2007, 03:06 PM
|
|
Registered User
|
|
Join Date: Jan 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Access Report Help - Grouping Data by Week Ending
Hi,
I have created a report that totals the number of days it took a product to ship by percentage by a date range for a specific location. My data comes from a query with the following headers:
[week ending date] [Packages Entered] [Entry Date] [Location] [Days In Transit]
I used a count iff to calculate the following headers in the report. This is a percent of the total number of packages.
[# of days <=4] [# of days <=5] [# of days <=6]
The report runs fine and gives me the info a need on a week to week basis but I need it to break out the data based on w/e. I am not sure how to go about this. I need it to look something like this. Currently it is only giving one line back no matter what date range I select or week ending date i pick.
[W/E Date] [Packages] [Location] [# of days<=4] [# of days<=5] [# of days<=6]
23-Dec 500 New York 25% 50% 100%
16-Dec 475 New York 35% 75% 100%
Any help would be appreciated.
|
|

January 17th, 2007, 08:30 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
You can group these week ending dates using the "ww" datepart.
In your query, add a column and use this as the field name and expression:
WorkWeek:(DatePart("ww", [week ending date]))
Try this and you will see that the dates will report back the work week they are in during the year. 9/13/2006 will yield "37", for example, and 9/22 will yield "38".
Then group on this field, and not the date field.
You shouldn't have spaces in your field names, BTW.
HTH
mmcdonal
|
|

January 17th, 2007, 10:05 AM
|
|
Registered User
|
|
Join Date: Jan 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
will this break the week ending dates on the report as well no matter what the date range is?
|
|

January 17th, 2007, 10:07 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
If you group the report on this column, then only those dates with the work week number will be in the group.
mmcdonal
|
|

January 17th, 2007, 10:31 AM
|
|
Registered User
|
|
Join Date: Jan 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I did this and it still sums everything together. The way I have my query setup it asked for a location# and date range. Lets say the location # is 100 and I enter a date range of 12/2/06 - 12/30/06 I want the date to look something like this:
[W/E Date] [Packages] [Location] [# of days<=4] [# of days<=5] [# of days<=6]
23-Dec 500 New York 25% 50% 100%
16-Dec 475 New York 35% 75% 100%
In the current state it sums everything togetheron on one line, i.e. packages = 975.
Thanks,
Derek
|
|

January 17th, 2007, 10:33 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
What is your table structure, and what does the query look like behind the report?
mmcdonal
|
|

January 17th, 2007, 10:37 AM
|
|
Registered User
|
|
Join Date: Jan 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The table is just date imported from a text file. The trick is I need the report to make my calcualtion on % delivered. I wrote the query to give me data back based on a date range and also location #. I can email if that will help.
|
|

January 17th, 2007, 10:46 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
Can you do the table structure, and then the SQL query?
Like:
tblShipping
ShippingID - PK
WEDate - Date
Location - text
etc
SELECT * FROM tblShipping etc.
mmcdonal
|
|

January 18th, 2007, 11:24 AM
|
|
Registered User
|
|
Join Date: Jan 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Here is my sql statement.
SELECT WeekEnding.[W/E], Count((DatePart("ww",[W/E]))) AS WorkWeek, [112606_123006_Raw].ZIP_5_DIG, [112606_123006_Raw].ENTRY_UNIT, [112606_123006_Raw].STOPCLOCK_FLG, [112606_123006_Raw].DELIVERED_FLG, [112606_123006_Raw].PU_DATE, [112606_123006_Raw].ENTRY_DATE, [112606_123006_Raw].DAYS_C
FROM 112606_123006_Raw LEFT JOIN WeekEnding ON [112606_123006_Raw].ENTRY_DATE = WeekEnding.Date
GROUP BY WeekEnding.[W/E], [112606_123006_Raw].ZIP_5_DIG, [112606_123006_Raw].ENTRY_UNIT, [112606_123006_Raw].STOPCLOCK_FLG, [112606_123006_Raw].DELIVERED_FLG, [112606_123006_Raw].PU_DATE, [112606_123006_Raw].ENTRY_DATE, [112606_123006_Raw].DAYS_C
HAVING ((([112606_123006_Raw].ENTRY_UNIT)=[Enter SCF]) AND (([112606_123006_Raw].ENTRY_DATE) Between [Enter Beginning Date] And [Enter Ending Date]));
|
|
 |