Click here to Skip to main content
15,905,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello all

i have table like these....

srno,name,present,date
1 aaa P 1-1-11
2 aaa A 2-1-11
3 aaa P 3-1-11
4 bbb P 1-1-11
5 bbb P 2-1-11
6 bbb P 3-1-11


i want crystal report like these format

name present absent
aaa 2 1
bbb 3 0

how can i calculate only ( P or A ) in crystal report.
Posted

Hi,
I think you might required "Cross tab Query". Googled with 'Cross tab query in Sql server'. See the below links, Might be helpful.

1) Crosstab queries using PIVOT in SQL Server 2005[^]
2) What is a CrossTab Query?[^]
3) dynamic-cross-tabs-pivot-tables[^]
 
Share this answer
 
create a formula field using this formula
if {subjectdata.value}="Y" then 1


this will give you a field that has a 1 when present and 0 when absent.

Hope this will give an idea.
 
Share this answer
 
Use this, that's all.

Conditional Total using an If-Then-Else formula[^]

Let us know
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900