Hi, I am new to Crystal Reports and SQL2008 R2. Actually, I have a Crystal Report where I am using an SQL Stored Procedure. In that Stored Procedure, I display data in Crystal Report.
I wrote a Stored Procedure like that found at the link below:
how insert print data to another table ?[
^]
In the above link, I am sorting data in another table, from that table, I have to write SQL query like this:
select section,partice,rating ,date,marks,score,class, signature,remarks where id='1'
select section,partice,rating ,date,marks,score,class, signature,remarks where initial_grade>'0' where id='1'
select section,partice,rating ,date,marks,score,class, signature,remarks where initial_grade<='0' where id='1'
I want to JOIN these three queries and display as one table like this:
output1:if initilal_grade is zero only for particular id='1'
section partice rating initial_grade after intial_grade remarks
date marks score date marks score
1 xx 3 12-4-2013 23 45
1 xx 3
output2:if initilal_grade is 1(mean if i change to zero to 1) only for particular id='1'
section partice rating initial_grade after intial_grade remarks
date marks score date marks score
1 xx 3 12-4-2013 23 45
1 xx 3 12-4-2013 33 50
1 xx 5
12-4-2013 44 60
based on intial_grade(for intial_grade, I am passing two values 0 and 1) that date marks score columns should display. If 0 means it should look like output1. If it is 1, that means it should look like output2.
Please help me. I have used a lot of time to solve so far. Can any one help me an approach?
I think it will work by going like below.
I wrote a query like this:
How to remove unnecessary data?[
^]