Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URGENT DBT IN ACCESS

 
smitha verghese
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a doubt
I have a tables they are
Production table with fields(A,B,C,D)and Daywise_Report table with fields(E,F,G,H)
I need to find the SUM of C and AVERAGE of D from the production table and put them in Daywise_Report table G and H for distinct A and B fields.
can anybody help me?
[ June 26, 2003: Message edited by: smitha verghese ]
[ June 26, 2003: Message edited by: smitha verghese ]
[ June 26, 2003: Message edited by: smitha verghese ]
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try something like:
"INSERT INTO Daywise_Report ( E, F, G, H )
SELECT A, B, SUM(C), AVG(D)
FROM Production
GROUP BY A, B"
Worked form me in Access.
Jamie
 
smitha verghese
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for ur reply
i got A BIT OF IT STILL MORE DBTS
This query worked fine 4 me
SELECT DATE1,NAME,SUM(LINE_COUNT) AS LCOUNT,AVG(QUALITY) AS ACCURACY FROM Production GROUP BY NAME,DATE1;

But when i included MT_ID field
SELECT DATE1,NAME,MT_ID,SUM(LINE_COUNT) AS LCOUNT,AVG(QUALITY) AS ACCURACY FROM Production GROUP BY NAME,DATE1;

it returns the error
"You tried to execute a query that does not include the specified experssion MT_ID as a part of the aggregate function"
Pls let me know what can be done
Thanks in advance
regards
Smitha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic