Urgent query needed

L

lee

event mode max_wgt
pi t 2000
ppi l 300000
pddi t 23000
pd t 12000
ippd l 50000


i want to calculate total of max wgt for every event and mode
combination. Event column would have only 2 values either that ends
with i or that ends with d . so i want a sql query in access which
will give the output

as the following table

event mode totalof max wgt
i t
i l
d l
d t


can you pls suggest
 
J

John W. Vinson

event mode max_wgt
pi t 2000
ppi l 300000
pddi t 23000
pd t 12000
ippd l 50000


i want to calculate total of max wgt for every event and mode
combination. Event column would have only 2 values either that ends
with i or that ends with d . so i want a sql query in access which
will give the output

as the following table

event mode totalof max wgt
i t
i l
d l
d t


can you pls suggest

SELECT Right([Event], 1) AS EventType, Mode, Sum(Max_Wgt)
FROM yourtable
GROUP BY Right([Event], 1), Mode;
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
L

lee

event  mode  max_wgt
pi         t         2000
ppi        l        300000
pddi      t         23000
pd         t       12000
ippd      l        50000
i want to calculate    total of max wgt for every event and mode
combination. Event column would have only 2 values either that ends
with i or that ends with d . so i want a sql query in access which
will give the output
as the following table
event  mode   totalof max wgt
i           t
i           l
d           l
d          t
can you pls suggest

SELECT Right([Event], 1) AS EventType, Mode, Sum(Max_Wgt)
FROM yourtable
GROUP BY Right([Event], 1), Mode;
--

             John W. Vinson [MVP]
 Microsoft's replacements for these newsgroups:
 http://social.msdn.microsoft.com/Forums/en-US/accessdev/
 http://social.answers.microsoft.com/Forums/en-US/addbuz/
 and see alsohttp://www.utteraccess.com

thanks John. appreciate it. much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

query help urgent needed 1
sql help req 1
query needed please help 6
complex sorting query 3
Pls help with SQL query 12
Query Help 2
Query for comparison of totals 11
Query needed pls urgent 2

Top