Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RunningCount

Status
Not open for further replies.

phpatrick

Programmer
Jul 9, 2006
72
BE
Code:
SELECT [ID_TIME], [WEEKDAG], [WEEK], [refCCT], [PRESENT], [NAME], [CCTNAME], [CCTFORNAME], [DAG], [SHIFT1VAN], [SHIFT1TOT], [refTEELTSHIFT1], [SHIFT2VAN], [SHIFT2TOT], [refTEELTSHIFT2], [SHIFT3VAN], [SHIFT3TOT], [refTEELTSHIFT3], [PLUS], [MIN], [PLUSMINUTES], 
(SELECT Count(*)
FROM 
Q_04_TIMEDAG 
WHERE Q_04_TIMEDAG.ID_TIME <= Q_04_TIMEDAG2.ID_TIME) AS RunningCount 
FROM Q_04_TIMEDAG As Q_04_TIMEDAG2;

I encounter few problems in creating a runningcount.
First he can't save the query, he said record deleted
Second, I can't add new records to this query.
I need this to set alternated colors to my records
 
It says "record deleted" when you try to save the query in design or SQL view? Seems unlikely. At the time you are saving the query, Access is checking it for syntax but not running it. Exactly how are you attempting to save the query?

This query, because it contains a computed field (RunningCount), is not updatable and you will not be able to add records to it. You can however, add records to the underlying table and then run the query again.
 
Do you really have a table with the fields:

Shift1Van, Shift1Tot, RefTeeltShift1
Shift2Van, Shift2Tot, RefTeeltShift2
Shift3Van, Shift3Tot, RefTeeltShift3

you should read the fundamentals document linked below and consider normalizing your tables.




Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top