Click here to Skip to main content
15,891,431 members

i have a gridview called budget in which i want to show data yearwise ?

Revision 1
SQL
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 what i want is 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 :

string str = string.Format(@"select m.pcode, m.fyyear, m.date, m.salary, m.ta, m.contigency, m.nrc, m.institcharges, m.others, p.total FROM monthly AS m inner join project p on p.pcode=m.pcode where m.pcode = '{0}'", DropDownList1.SelectedItem.Value.ToString());
Posted 19-Jan-13 16:55pm by a2ulthakur.