SELECT m.pcode, m.fyyear, m.date, m.salary, m.ta, m.contigency, m.nrc, m.institcharges, m.others, p.total, y.yearlyalloc
FROM monthly AS m INNER JOIN
project AS p ON p.pcode = m.pcode INNER JOIN
yearly AS y ON y.pcode = m.pcode
this is my sql query, i want to display yearly allocation(yearlyalloc) according financial year(fyyear). which means my columns pcode,date,salary,ta,contingency,nrc,institcharges,others,yearlyalloc should be shown according to financial year. basically i want to group them according to financial years, but only two tables of mine contain fyyear.
eg: in my gridview i want to display data like this
pcode fyyear date salary ta contigency nrc instit ..yearlalloc
adhoc 110 2010-2011 03/04/2010 16000 1000 120 0 0 120000
.
.
.
adhoc 110 2011-2012 03/04/2011 16000 1000 120 0 0 180000
the code behind that i am using only binds two tables and i have to insert y.yearlyalloc from yearly and group data according to fyyear(financial year) plz help with the query