• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URGENT DBT IN ACCESS

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic