Sql syntax error? and running sum? help?

Can you try to see in Qr2?
 
You need to tell me exactly what employee I should look at and what results you expect. I don't really have the time to start trying to understand what's going on.
 
Ayear AMonth ΕΠΩΝΥΜΟ ΔΙΑΦΟΡΑ ΣΕ ΩΡΕΣ ΣΥΝΟΛΑ
2010 1 ΑΡΓΥΡΕΛΗΣ -17 -17
2010 8 ΑΡΑΜΠΙΔΟΥ -25 -25
2010 11 ΑΒΡΑΑΜ -20,64 -30
2010 11 ΑΒΡΑΑΜ -9,71 -30
2010 12 ΑΒΡΑΑΜ -17 -67
2010 12 ΑΒΡΑΑΜ -20 -67
2011 1 ΑΡΑΜΠΙΔΟΥ 3,64 -30
2011 1 ΑΒΡΑΑΜ -17 -16
2011 1 ΑΡΑΜΠΙΔΟΥ -34 -30
2011 1 ΑΡΧΟΝΤΑΚΗΣ 13,60 13,60
2011 2 ΑΒΡΑΑΜ - 1,21 -25,49
 
I expect to have..

Ayear AMonth ΕΠΩΝΥΜΟ ΔΙΑΦΟΡΑ ΣΕ ΩΡΕΣ ΣΥΝΟΛΑ
2010 1 ΑΡΓΥΡΕΛΗΣ -17 -17
2010 8 ΑΡΑΜΠΙΔΟΥ -25 -25
2010 11 ΑΒΡΑΑΜ -20,64 -20,64
2010 11 ΑΒΡΑΑΜ -9,71 -30,35
2010 12 ΑΒΡΑΑΜ -17 -47,35
2010 12 ΑΒΡΑΑΜ -20 -67,35
2011 1 ΑΡΑΜΠΙΔΟΥ 3,64 -17
2011 1 ΑΒΡΑΑΜ -17 -84,35http://www.access-programmers.co.uk/forums/editpost.php?do=editpost&p=1042330
 
A running sum? It cannot be done in a query with your set of records.

You can do it in a report.
 
Ok.. i am dissapointed by access if it is true.... Thank you so much and my appologies althought i thought we reached perfection...
 
I thought you had tha in mind.. and my apologies for keeping you without having told that. Thank you so much i am sure there must be a way.. if i bring datepart in the expression
 
How does the DSum() know to sum the first n amounts that relate to an employee? You don't have such a field in your query.
 
I am stuck.. an of ideas anymore saw somehere a counter mayby if there was a counter to give autonumber by employee somehow
 
I realize its 03 10 here.. have a good night maybe db is not for the time. have an early start... ;) thank you so much
 
If there was a field that started from 1 to n then yes it is possible. By now you're thinking of creating a temp table with an Autonumber ID. This will work but if you change the sort order the query will fail.

So it's not worth stressing yourself over this. It can't be done in a query with those results. Just do it in a report.
 
Could a report sum the workhours for every employee, during weeks and months? That was my problem and that's why i am so stretched about managing the specific query. I think maybe report cannot find the previus workhours of each one and sum it because i need to have a report to present workhours of all employees during each month.. ( so could that be a problem?) I do not know. And.. There is one think i need to ask. How could i insert the already result of workhours as a number of everyone so they are calculated to the day i shal start using tha database?
 
Could a report sum the workhours for every employee, during weeks and months? That was my problem and that's why i am so stretched about managing the specific query. I think maybe report cannot find the previus workhours of each one and sum it because i need to have a report to present workhours of all employees during each month.. ( so could that be a problem?) I do not know.
http://office.microsoft.com/en-us/access-help/summing-in-reports-HA001122444.aspx

How could i insert the already result of workhours as a number of everyone so they are calculated to the day i shal start using tha database?
A grand sum of work hours irrespective of the employee?

http://office.microsoft.com/en-us/access-help/sum-data-by-using-a-query-HA010096310.aspx
 

Users who are viewing this thread

Back
Top Bottom