I have a sql query that runs fine but it returns results from 2 different tables that contain a breakdown of contracts and the projects that belong to them.
An example of this is: Contract number 12004 contains Projects 12004C, 12004D, 12004F
is there a way I can get all 12004 to group together under the 12004 banner contract Number?
My query as it stands to get me the current info is:
SELECT PA01201.PACONTNUMBER, PA01201.PAPROJNUMBER, PA01201.PAprojname, PA01100.PAcontname
FROM PA01201 INNER JOIN
PA01100 ON PA01201.PACONTNUMBER = PA01100.PACONTNUMBER
basically i am trying to get all the figures from PAPROJNUMBERS (C,D,F etc) to form one line of a subtotal under PACONTNUMBER
I have tried a 'Group By' but get a Ambiguous column name 'PACONTNUMBER'???
Any help at all much appreciated.
Thanks for the help. Much appreciated. I will keep trying different things.
In response to using aggregates that's not really what I was trying to do.
Basically in my example of projects 12004C, 12004D, 12004F etc I just want them all to wrap up under 12004. so it would look something like this..............
Contract Figures Description:-
12004 25000 SS Bus Station
12005 xxxxx xxxxxxxx
12006 xxxxx xxxxxxxx
12007 xxxxx xxxxxxxx
12008 xxxxx xxxxxxxx
instead of how it looks at the moment:-
Contract Figures Description
12004 6000 SS Bus Station
12004C 8000 SS Bus Station
12004D 1000 SS Bus Station
12004F 10000 SS Bus Station
12005 xxxxx xxxxxx