Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 crosstab with 2 tables

Author  Topic 

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2006-08-10 : 11:14:31
hi

i have 2 table namely tblDate and tblData

tblDate has a column which stores 4 or 5 rows of dates and it has dynamic value meaning the values of the 4 rows would change every month

tblDate ---- (this month date)

ColDate
-----------
08/05/2006
08/12/2006
08/19/2006
08/26/2006

Then come next month

ColDate
-----------
09/02/2006
09/09/2006
09/16/2006
09/23/2006
09/30/2006

For tblData, I have 4 columns for month august:

Col1 Col2 Col3 Col4


How do i change the names of the columns from Col1 Col2 Col3 Col4 to wk1-08/05/2006 wk2-08/12/2006 wk3-08/19/2006 wk4-08/26/2006 for tblData based on the value from tblDate on monthy basis dynamically? Thanks

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-10 : 12:15:11
http://weblogs.sqlteam.com/jeffs/archive/2005/05.aspx


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2006-08-10 : 12:24:36
hi

The information is just so overwhelming and i am blur and do not know where to start from?
Go to Top of Page

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2006-08-11 : 00:09:26
sorry if i cause much inconvenience. Thanks
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-08-11 : 00:16:31
You can use the SP_RENAME stored procedure to rename a column in a table.


CODO ERGO SUM
Go to Top of Page
   

- Advertisement -