Hi ,

I am a newbie on SQL server 2000, basically I am from DB2 and Oracle DBA environ.

I am stuck in creating a procedure where in I ahve to create a table based on some other table columsn sumation fields just like cross tab in Access.

Like I have a table
dbo.TBLCIdata

CIID DEPTNUM CIDATA CIPRD CIDTTM LOGDT
634 s3333 6.4 Q 3/31/2008 0:00 7/2/2009 9:59
634 s3333 1.3 Q 6/30/2008 0:00 6/11/2009 16:40
630 e7970 8 M 7/31/2008 0:00 6/10/2009 16:46
630 e7973 9 M 7/31/2008 0:00 6/10/2009 16:46
635 s2222 8.2 Q 3/31/2008 0:00 7/2/2009 11:01
636 s2222 58.99 Q 3/31/2008 0:00 7/2/2009 11:01
634 d27201 0 Q 12/31/2008 0:00 7/8/2009 0:00
634 d27201 0 Q 3/31/2009 0:00 7/8/2009 0:00
634 d27201 0 Q 9/30/2008 0:00 7/8/2009 0:00
630 e7975 4 M 7/31/2008 0:00 6/10/2009 16:46
630 e7978 4 M 7/31/2008 0:00 6/10/2009 16:46
630 g7979 12 M 7/31/2008 0:00 6/10/2009 16:46

My requirement is from TBLCIData

CIDTTM is the end of month data entered as CIDATA for corresponding CIID and DEPTNUM.

Now I want to use the cross tab stored procedure on SQL 2000 to generate a new table having columns as mentioned belowwhich sumarizies CIDATA absed on CIDTTM.

CIID DEPTNUM SUMCIDATA CIPERIOD
634 s3333 7.9 6/30/2008 0:00
630 e7978 10 7/31/2008 0:00

ALso I have seen an equivalent cross tab procedure for SQL 2000, but I dont know how to use that and is it right to use that.

It will be a big help as Ia m badly stuck for this resolution.

Thanks & regards

neh