General information
Forum:
Microsoft SQL Server
Steven
Not really a cross-tab since you only have one variable. It would be a cross-tab if you wanted to know number that started for each Dr.
But, anyway, you can do what you want using count()
SELECT
count(datepart(m,@startdatein)=datepart(m,startdate) As Month1
,count(datepart(m,@startdatein)<=datepart(m,startdate) As Month1
....
WHERE startdate > @startdatein
I haven't test this, but it should get you started.
BOb
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only