Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Convert this Query in to Cross-Tab? 1

Status
Not open for further replies.

nomi2000

ISP
Feb 15, 2001
676
CA
Hi i have a table which has record showing like this
query might be like

Select REF_CODE ,TYPE ,DESC
DATEDIFF(day, Originated_Date, EventCreated_Date) AS no_of_days
FROM SOMETABLE

CREATED_DATE
REF_CODE TYPE DESC NO_OF_DAYS
NM001 DSP-5 Draft 28
NM001 DSP-5 Completed 45
MR990 DSP-5 Draft 135
MM61001 DSP-61 Draft 61
MM61001 DSP-61 Completed 69
MM61001 DSP-61 Signed 118
MM00000008 DSP-5 Completed 88
MM00000008 DSP-5 Draft 168
MM00000005 DSP-5 Signed 192

I want to show like this
REF_CODE TYPE DRAFT COMPLETED SIGNED
NM001 DSP-5 28 45 <NULL>
MR990 DSP-5 135 <NULL> <NULL>
MM61001 DSP-61 61 69 118
MM00000008 DSP-5 88 168 192

Can i do this?
Thanks

Nouman Zaheer
Software Engineer
MSR
 
Yes, it can be done. Check the following FAQs:

faq183-5269
faq183-5278

and threads:

thread183-451930
thread183-872564




Krickles | 1.6180

 
Thanks Krickles

Nouman Zaheer
Software Engineer
MSR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top