Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 16th, 2007, 03:06 PM
Registered User
 
Join Date: Jan 2007
Location: Fra, , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

Reply With Quote
  #2 (permalink)  
Old January 17th, 2007, 08:30 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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
Reply With Quote
  #3 (permalink)  
Old January 17th, 2007, 10:05 AM
Registered User
 
Join Date: Jan 2007
Location: Fra, , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

will this break the week ending dates on the report as well no matter what the date range is?

Reply With Quote
  #4 (permalink)  
Old January 17th, 2007, 10:07 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

If you group the report on this column, then only those dates with the work week number will be in the group.

mmcdonal
Reply With Quote
  #5 (permalink)  
Old January 17th, 2007, 10:31 AM
Registered User
 
Join Date: Jan 2007
Location: Fra, , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #6 (permalink)  
Old January 17th, 2007, 10:33 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

What is your table structure, and what does the query look like behind the report?

mmcdonal
Reply With Quote
  #7 (permalink)  
Old January 17th, 2007, 10:37 AM
Registered User
 
Join Date: Jan 2007
Location: Fra, , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Reply With Quote
  #8 (permalink)  
Old January 17th, 2007, 10:46 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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
Reply With Quote
  #9 (permalink)  
Old January 18th, 2007, 11:24 AM
Registered User
 
Join Date: Jan 2007
Location: Fra, , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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]));


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grouping with calculated field in report jack123 Access 3 August 9th, 2007 06:46 AM
Grouping Within a Report for labels ermy78 Access 17 December 14th, 2006 12:49 PM
Grouping - Summing - Report Generation Hylvenir XSLT 3 May 6th, 2006 07:34 AM
Crystal Report Grouping B.V.Madhav Crystal Reports 1 June 6th, 2005 12:21 PM



All times are GMT -4. The time now is 02:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.