473,396 Members | 1,756 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.

Need Help with counting weekly dates. One more time.

I am having a problem grouping by week. I am looking for the
simpliest way of doing it in Microsoft Access. I have tried to use a
pre-loaded calender, access did not like it at all. If there is
another way of counting the number of ProblemCounts with a single
week, by using DatePart etc. Give me a shout. Thanks.

Something similar to

Before:

Date ProblemCount
--------- ---------
10/02/04 2
10/04/04 4
10/08/04 3
10/16/04 1
11/02/04 3
11/03/04 1

AFTER:

Week Of ProblemCount
--------- ----------
10/07/04 6
10/14/04 3
10/21/04 1
10/28/04 0
11/04/04 4
Nov 13 '05 #1
4 1726
First, change the name of the "Date" field to anpther name. "Date" is a reserved
word in Access and using it will give you problems!

Create a query and put the following expression in the first field:
WeekNum:Format([NameOfDateField],"ww")
Put ProblemCount in second field.

Change the query to a totals query by clicking the Sigma button on the toolbar
at the top of the screen. (Looks like a capital "E"). Under ProblemCounts,
change Group By to Count. Run the query.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Alicia" <al******@hotmail.com> wrote in message
news:d3**************************@posting.google.c om...
I am having a problem grouping by week. I am looking for the
simpliest way of doing it in Microsoft Access. I have tried to use a
pre-loaded calender, access did not like it at all. If there is
another way of counting the number of ProblemCounts with a single
week, by using DatePart etc. Give me a shout. Thanks.

Something similar to

Before:

Date ProblemCount
--------- ---------
10/02/04 2
10/04/04 4
10/08/04 3
10/16/04 1
11/02/04 3
11/03/04 1

AFTER:

Week Of ProblemCount
--------- ----------
10/07/04 6
10/14/04 3
10/21/04 1
10/28/04 0
11/04/04 4

Nov 13 '05 #2
al******@hotmail.com (Alicia) wrote in message news:<d3**************************@posting.google. com>...
I am having a problem grouping by week. I am looking for the
simpliest way of doing it in Microsoft Access. I have tried to use a
pre-loaded calender, access did not like it at all. If there is
another way of counting the number of ProblemCounts with a single
week, by using DatePart etc. Give me a shout. Thanks.

simplest way - let Access do it in a report. Group by the date, then
choose week, or do it in a query and do something like this...

SELECT tblVouchers.DateCreated,
DateSerial(Year([datecreated]),1,Day([datecreated])) AS WeekNo,
DateDiff("ww",[weekno],[datecreated])+1 AS Expr1
FROM tblVouchers;
Nov 13 '05 #3
al******@hotmail.com (Alicia) wrote in message news:<d3**************************@posting.google. com>...
I am having a problem grouping by week. I am looking for the
simpliest way of doing it in Microsoft Access. I have tried to use a
pre-loaded calender, access did not like it at all. If there is
another way of counting the number of ProblemCounts with a single
week, by using DatePart etc. Give me a shout. Thanks.

simplest way - let Access do it in a report. Group by the date, then
choose week, or do it in a query and do something like this...

SELECT tblVouchers.DateCreated,
DateSerial(Year([datecreated]),1,Day([datecreated])) AS WeekNo,
DateDiff("ww",[weekno],[datecreated])+1 AS Expr1
FROM tblVouchers;
Nov 13 '05 #4
pi********@hotmail.com (Pieter Linden) wrote in message news:<bf*************************@posting.google.c om>...
al******@hotmail.com (Alicia) wrote in message news:<d3**************************@posting.google. com>...
I am having a problem grouping by week. I am looking for the
simpliest way of doing it in Microsoft Access. I have tried to use a
pre-loaded calender, access did not like it at all. If there is
another way of counting the number of ProblemCounts with a single
week, by using DatePart etc. Give me a shout. Thanks.

simplest way - let Access do it in a report. Group by the date, then
choose week, or do it in a query and do something like this...

SELECT tblVouchers.DateCreated,
DateSerial(Year([datecreated]),1,Day([datecreated])) AS WeekNo,
DateDiff("ww",[weekno],[datecreated])+1 AS Expr1
FROM tblVouchers;


Yes, but will that skip a week and group by the date for me? I
basically wanted something that would do a count of the dates, then
group them by their week name..

BEFORE:

Resource Date Total number of times that date Appeared
(Count)
4/3/03 4
4/4/03 2 (note 4/4/03 showed up
twice)
4/9/03 1
4/10/03 7
I WANT TO CREATE THIS RESULT:

Resource Date CountbyWeek
4/7/03 6 (The first week of the
month)
4/14/03 8 (second week)

I am basically doing this stuff for charting purposes, so I can create
bar graphs was my data by weeks of the month instead of everyday.
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Shlomi Schwartz | last post by:
Hi all, Why do I get the folowing date when creating it like so: var d = new Date(2003,9,2); Wed Oct 1 23:00:00 UTC+0200 2003 Isent it soposed to be:
6
by: edwardfredriks | last post by:
I'm looking for a script that, instead of counting down, can "count up" from a given date. So the output should be something like "(xx) days since (date/event)" or "(date/event) was (xx) days ago"....
20
by: none | last post by:
I have managed to get the below script *almost* working. However, it still has a problem calculating the number of months. The date I am trying to calculate from is Oct 15, 1994. With the correct...
14
by: jpr | last post by:
Friends, I have a form with four fields, date1, date2, date3 and date4. All these have all a mm/dd/yyyy format and have their source to a table. I need to add an unbound control (I will name...
6
by: | last post by:
Why is my progress bar displayed only after it's reached 100%? <html> <style type="text/css"> #bar{ width: 10px; height: 14px; color: white; font-size: 12px; overflow: hidden;
2
by: MLH | last post by:
With a table of holidays and A97's date fn's - how best to count weekends and holidays between two dates? My holiday table has 4 fields. I will be adding records to it each year as info becomes...
0
by: ambelkar | last post by:
hi, I trying to join weekly & daily tables by using end_dte,Rpt_dte respectively.My week is saturday to friday.first table only having week end' dates but the 2 daily table having daily dates .when...
7
by: Lucas_london via AccessMonster.com | last post by:
Hi I have set up a database/tables in Access based on daily timeseries data. However I would like to create two additional columns in the table as a basis to pull the data on a weekly and...
2
by: aszush | last post by:
//Title: Programming Assignment 1 //Version: //Copyright: Copyright (c) 1999 //Author: Andrew //Company: //Description: Computes employee's weekly gross and net pay....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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:
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.