Hi Everybody, is here anyone who has generated a pivot table from a table containing a datatime column Explain: create table Sales ( City varchar(50), SaleDate DATETIME, Value DECIMAL(20,2) ) i have generated a table from data of this table that looks like: City April 1 2008 May 1 2008 Wa 2.5 6.5 the pb is that the name of dates columns are in a varchar format : April 1 2008 I want this table which has this form: City 2008/04/01 2008/05/01 Any ideas?Thanks in advance
Please check the nice article: http://msdn.microsoft.com/en-us/library/ms177410.aspx Thank you, Sandy.
[quote user="AMOURGH"]Hi Everybody, is here anyone who has generated a pivot table from a table containing a datatime column Explain: create table Sales ( City varchar(50), SaleDate DATETIME, Value DECIMAL(20,2) ) i have generated a table from data of this table that looks like: City April 1 2008 May 1 2008 Wa 2.5 6.5 the pb is that the name of dates columns are in a varchar format : April 1 2008 I want this table which has this form: City 2008/04/01 2008/05/01 Any ideas? Thanks in advance[/quote] Try using convert function