473,387 Members | 1,603 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,387 software developers and data experts.

Query to get total hours prior to a specific date.

Hi there:

This query seems like it should be so simple, however since the date
field returns different dates, the sum grouping is not working (as
desired). What do I need to do to get this to return the sum of
hours...
SELECT Time.Hours, Time.Person, Time.ProjectID, Time.WeekStartDate
FROM Time
WHERE (((Time.Person)=[Person?]) AND ((Time.ProjectID)=[Project ID?])
AND ((Time.WeekStartDate)<=[WeekStartDate?]));

Thanks in advance!

Jan 19 '07 #1
1 1905
SELECT Sum(Hours) AS TotalHours, Person, ProjectID
FROM [Time]
WHERE WeekStartDate<=[WeekStartDate?]
GROUP BY Person, ProjectID
HAVING Person=[Person?] AND ProjectID=[Project ID?];

The problem was probably that you were trying to include the date as a
group by when it should just be included in the where.

Cheers,
Jason Lepack

te*******@gmail.com wrote:
Hi there:

This query seems like it should be so simple, however since the date
field returns different dates, the sum grouping is not working (as
desired). What do I need to do to get this to return the sum of
hours...
SELECT Time.Hours, Time.Person, Time.ProjectID, Time.WeekStartDate
FROM Time
WHERE (((Time.Person)=[Person?]) AND ((Time.ProjectID)=[Project ID?])
AND ((Time.WeekStartDate)<=[WeekStartDate?]));

Thanks in advance!
Jan 19 '07 #2

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

Similar topics

5
by: Norma | last post by:
I am trying to make a query pull data from between the dates I enter in the parameter but also look back 'in time' to see where 2 other fields have null values, and only pull data into the query if...
3
by: Jamie Pittman via AccessMonster.com | last post by:
I am having trouble bellow wit this query. I have the total regular hours and the overtime. The problem is that if it is 8 hours and under, I need it to show as regular hours. Any thoughts? ...
5
by: ????? | last post by:
I have an access query which gets data from a number of different tables. Although the tables have primary key fields, the order in which the records are returned means that none of these are in...
1
by: ????? | last post by:
I have a query which shows the following fields and orders by every one in turn from left to right in ascending order. The fields are DATE, , WORK, *, DESCRIPTION and . How can I get a running...
30
by: Noob | last post by:
ftp://ukcassassin:winston@www.ukcassassin.pwp.blueyonder.co.uk/htdocs/Diary%20Form.bmp Hi all I will appologise in advance for my lack of knowledge of access and its working as i am quite new to...
4
by: pokerboy801 | last post by:
OK, I will try to explain this as clearly and as concise as possible. I am using Access, which has three MS Excel Linked tables, to store call center metrics for reps. My Excel workbook has three...
1
by: silversubey | last post by:
I am using a query to total hours (Cltbudget.CBudhours) and dollars (CltBudget.CBudFee) Grouped by client names (Cltbudget.CBudCltName). here is the Query: SELECT CltBudget.CBudCltName AS Client...
16
by: Alex30093 | last post by:
OK This is my 1st post to any forum, but I rely on forums all the time. Short story is I find myself needing to become a Access DBA for work. Situation: I want to use one table of events that...
7
by: Ecohouse | last post by:
I'm working on a project that was dropped in my lap. It is in Access 2003. There are short time fields which get calculated values (eg. 1:30). But I will need to total up those values for...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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...

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.