473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Summing Data by Calendar Week

Hello. I need to find a way to sum data by calendar week. For example, I receive sales and shipping data from various days during the week. I need to be able to sum this data to get a single value for each software title for each week. This data spans over several years. Any help would be greatly appreciated. Thank you.
Aug 6 '07 #1
1 2046
ADezii
8,834 Expert 8TB
Hello. I need to find a way to sum data by calendar week. For example, I receive sales and shipping data from various days during the week. I need to be able to sum this data to get a single value for each software title for each week. This data spans over several years. Any help would be greatly appreciated. Thank you.
A Crosstab Query with Fixed Column Headings of "1","2","3",..."52" and proper formatting of the Column Headers ( Format([Date],"ww")) should do the trick, but first, a couple of Assumptions:
  1. Table Name: tblCrosstab
  2. Field Names:
    1. [Date] - DATE/Time
    2. [Title] - TEXT
    3. [Sales] - CURRENCY
Expand|Select|Wrap|Line Numbers
  1. TRANSFORM Sum(tblCrosstab.Sales) AS Sum_Of_Sales_By_Week
  2. SELECT tblCrosstab.Title, Sum(tblCrosstab.Sales) AS [Tota Sales By Week]
  3. FROM tblCrosstab
  4. GROUP BY tblCrosstab.Title
  5. PIVOT Format([Date],"ww") In ("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18",
  6. "19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34" ,"35","36","37","38","39","40","41","42","43","44","45","46","47","48","49", "50","51","52");
Aug 6 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: cg_news | last post by:
In short, what I am trying to do is, based on a date, calculate the week of year (as described in ISO 8601), then calculate the first and last date in this week period and return them in the format...
7
by: Shuffs | last post by:
Could someone, anyone please tell me what I need to amend, to get this function to take Sunday as the first day of the week? I amended the Weekday parts to vbSunday (in my code, not the code...
15
by: tigrfire | last post by:
I'm trying to write a program that will display the following output: MONTHLY CALENDAR This program displays a calendar. You need to provide the day of the week on which January 1 falls, and...
2
by: patrick delifer | last post by:
I am binding some data to a calendar control. Since I don't want to return all the Data from the DB, I would like to return only the data for the current view of the calendar. The calendar has...
2
by: bb | last post by:
any way to prevent displaying the previous and next months in the calendar control? i have tried just blanking the text out in the dayrender IsOtherMonth and also dynamically changing the...
0
by: david.paik | last post by:
Given the data: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="C:\junk\830new.xslt"?> <SC830> <SC830_3 bano="S67777" cuno="002620" year="2007" week="38"...
0
by: mathewgk80 | last post by:
HI all, I am having popup calendar Javascript code. But i dont know how it is connecting to asp.net code.. I am using asp.net,c#.net and also using 3tier architecture with master page.... I...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
1
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.