Link to home
Start Free TrialLog in
Avatar of mainrotor
mainrotor

asked on

I need help building Pivot tables and cross tab queries in SQL

Hi Experts,
Is there a way to dynamically build cross tab queries and pivot tables in SQL?  If I build an application that will allow the user to select up to 3 fields, could this be done?

Thanks in advance,
mrotor
Avatar of mayank_joshi
mayank_joshi
Flag of India image

ASKER CERTIFIED SOLUTION
Avatar of Imran Javed Zia
Imran Javed Zia
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you can go totally dynamic with dynamic sql....

or you could go partially dynamic if you have selection criteria that
allow for it...

what are you allowing the users to select ....

the pivoted columns (range)?
or the columns against which the data is to be displayed?

can you handle the naming of the columns on the returned result set?
Avatar of mainrotor
mainrotor

ASKER

Lowfatspread, I am allowing the users to select the columns.
Lowfatspread,
I am allowing the users to select the columns against which the data is to be displayed.