473,789 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Summing Data by Calendar Week

1 New Member
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 2065
ADezii
8,834 Recognized Expert Expert
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
14882
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 CCYYMMDD. Sounds easy enough, right?? I am attempting to accomplish this by creating a GregorianCalender which will get me the week of year. Then by changing the day of week to 1 (start of week) i'm trying the get the first day of the week,...
7
15149
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 attached), yet when I ran it for 28/09/2003 (UK date format) it returned Week 39. I would have expected it to return Week 40. However, I'm really stuck and my head is busting over this, so any pointers would be gratefully appreciated. Many thanks...
15
3854
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 indicate whether or not the year is a leap year. Enter the code number for the day of the week on which January 1 falls: 0- Sun 1- Mon 2- Tue 3- Wed 4- Thu 5- Fri 6- Sat
2
6752
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 always 42 cells. I would like to know if there is a way to know which date is displayed in the first cell of the calendar. Unfortuantely, there is no index in the calendar. ( I could go with the SelectedDate.Today as a reference and then subtract and...
2
6978
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 FirstDayOfWeek to day 1 of the month. but neither works properly. (the boxes still appear just with no text in them) i want the calendar to start on day 1 of month and end on Day 31 (with acceptable trailing blanks between day 31 and the end of that...
0
1171
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" item="282-333" qty="10" PO1="PO242" PO2="PO343" PO3="" PO4=""
0
3328
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 would like to get the code for connecting the javascript to asp.net page... Please help me... The javascript code is as follows..
1
4910
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 events when click on that date that perticular event displyed in a text box.But my requirement is to when click on that date that related event displyed in same td row not the text box. and also i add the events to that calendar.plz advice how to...
1
3464
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 have to made in my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type"...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7529
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.