Hi,
I have a Sql Query Using Union
select Users.UserId,Users.EmpNo,(Users.FirstName+''+Users.LastName) As FullName,EmpPayments.SalBasic,EmpPayments.SalCon,EmpPayments.SalDA,EmpPayments.SalHRA from Users join EmpPayments on Users.UserId=EmpPayments.UserId where Users.UserId=24 and MainContractorSw='Y' and EmpPayments.MonthId=8 and EmpPayments.YearId=2010
Union
select Users.UserId,Users.EmpNo,(Users.FirstName+''+Users.LastName) As FullName,EmpPayments.SalBasic,EmpPayments.SalCon,EmpPayments.SalDA,EmpPayments.SalHRA from Users join EmpPayments on Users.UserId=EmpPayments.UserId where Users.MainContractorSw='N' EmpPayments.MonthId=8 and EmpPayments.YearId=2010 and Users.MainContractorId=24
Here the First Query will give the result of Contractor
and the second query will give the result of SubContractors whose contractor is the Contractor we get from First Query.
I have to Use this query in Crystal Report.
Now,How can i give the condition in Report Section because i have to use the 2 queries Conditions..
I have tried a lot Used 'AND' condition it is not retrieving anything and used 'OR' But the Results are repeating ......