Information générale
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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement