PATRICKGILL
IS-IT--Management
I need to generate an Access 2003 query that will produce a data summary of item sales history in monthly ranges that I can adjust.
Here is an simplified example data table I want to summarize:
ItemCode OrderDate Quantity
ABC-0001 5/5/2006 11:59:00 AM 3
ABC-0001 5/8/2006 9:42:00 AM 2
ABC-0002 5/10/2006 12:02:00 AM 5
PEN-0010 6/5/2006 11:59:00 AM 1
CAC-0001 7/2/2006 11:59:00 AM 3
ABC-0001 7/20/2006 11:59:00 AM 8
ABC-0001 7/5/2006 11:59:00 AM 1
ACT-0201 5/8/2006 11:59:00 AM 4
ACT-0201 5/5/2006 11:59:00 AM 5
Here is what I am looking to create in a query:
The first column (column A) should contain the product reference(ItemCode) - I can do this.
The second column(column B) should contain the beginning date of the period - I need help here.
The third column (column C) should contain a sum of the number of units sold during the period - I need help here to make it match the sum of the quantity for the desired period.
ItemCode OrderDatePeriod AmountSold
ABC-0001 5/1/2006 5
ABC-0001 6/1/2006 0
ABC-0001 7/1/2006 9
ABC-0002 5/1/2006 5
ABC-0002 6/1/2006 0
ABC-0002 7/1/2006 0
PEN-0010 5/1/2006 0
PEN-0010 6/1/2006 1
PEN-0010 7/1/2006 0
CAC-0001 5/1/2006 0
CAC-0001 6/1/2006 0
CAC-0001 7/1/2006 3
ACT-0201 5/1/2006 9
ACT-0201 6/1/2006 0
ACT-0201 7/1/2006 0
As you can see above I need the same date ranges for each item, if sales are 0 for that range I need to return a 0. Any item history in the range needs to summarize into the starting date period and the quantity sold as the sum for the AmountSold field. I would like to format the date to only show 6/1/2008, 7/1/2008, etc. for the range.
I am a novice Access user and really need step by step instructions on what to do. I am not sure if a function can do this or I need a date range table with a function. Thank you in advance for your help. Please let me know if you have any questions.
Here is an simplified example data table I want to summarize:
ItemCode OrderDate Quantity
ABC-0001 5/5/2006 11:59:00 AM 3
ABC-0001 5/8/2006 9:42:00 AM 2
ABC-0002 5/10/2006 12:02:00 AM 5
PEN-0010 6/5/2006 11:59:00 AM 1
CAC-0001 7/2/2006 11:59:00 AM 3
ABC-0001 7/20/2006 11:59:00 AM 8
ABC-0001 7/5/2006 11:59:00 AM 1
ACT-0201 5/8/2006 11:59:00 AM 4
ACT-0201 5/5/2006 11:59:00 AM 5
Here is what I am looking to create in a query:
The first column (column A) should contain the product reference(ItemCode) - I can do this.
The second column(column B) should contain the beginning date of the period - I need help here.
The third column (column C) should contain a sum of the number of units sold during the period - I need help here to make it match the sum of the quantity for the desired period.
ItemCode OrderDatePeriod AmountSold
ABC-0001 5/1/2006 5
ABC-0001 6/1/2006 0
ABC-0001 7/1/2006 9
ABC-0002 5/1/2006 5
ABC-0002 6/1/2006 0
ABC-0002 7/1/2006 0
PEN-0010 5/1/2006 0
PEN-0010 6/1/2006 1
PEN-0010 7/1/2006 0
CAC-0001 5/1/2006 0
CAC-0001 6/1/2006 0
CAC-0001 7/1/2006 3
ACT-0201 5/1/2006 9
ACT-0201 6/1/2006 0
ACT-0201 7/1/2006 0
As you can see above I need the same date ranges for each item, if sales are 0 for that range I need to return a 0. Any item history in the range needs to summarize into the starting date period and the quantity sold as the sum for the AmountSold field. I would like to format the date to only show 6/1/2008, 7/1/2008, etc. for the range.
I am a novice Access user and really need step by step instructions on what to do. I am not sure if a function can do this or I need a date range table with a function. Thank you in advance for your help. Please let me know if you have any questions.