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
 General SQL Server Forums
 New to SQL Server Programming
 SQL 2000 how to put dates between two given dates

Author  Topic 

ahaile
Starting Member

25 Posts

Posted - 2009-10-08 : 17:05:53
SQL 2000 how to put dates between two given dates across as column name.
givendate1 = '20090101'
givendate2 = '20090103'

Query:

Select * from table
where date is bewtween @givendate1 and @givendate2

Expected results:

20090101 20090102 20090103

Data1111 Data3102 Data5103
Data2111 Data4102 Data6103

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-10-08 : 21:55:22
try searching for PIVOTing in the SQL 2000 forum. Lots of example


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-09 : 11:47:07
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/dynamic-crosstab-with-multiple-pivot-columns.aspx
Go to Top of Page
   

- Advertisement -