As BitBucket has stated, it's a challenge to assume what you want without the basics needed for everyone to give it a whirl. Not sure if the example below is what you were intending, but maybe it can help point you in the right direction (or not :-D)CREATE TABLE #Guests (checkin date, checkout date, FullName varchar(50))
INSERT INTO #Guests
SELECT '10/12/2012', '10/16/2012', 'Corky Doe' U-NION ALL
SELECT '12/12/2012', '12/17/2012', 'Janice Doe' U-NION ALL
SELECT '11/12/2012', '11/24/2012', 'Howard Stern' U-NION ALL
SELECT '12/12/2012', '12/13/2012', 'Abagail Johnson' U-NION ALL
SELECT '12/12/2012', '11/15/2012', 'Teddy Sanft' U-NION ALL
SELECT '12/12/2012', '11/18/2012', 'John Overton' U-NION ALL
SELECT '12/12/2012', '12/19/2012', 'Sally Jenson' U-NION ALL
SELECT '12/12/2012', '10/20/2012', 'Tiffany Blue'
; WITH Served (NumOfDays, ByMonth) AS
(
SELECT COUNT(FullName), DATEPART(month, Checkin) [Month] FROM #Guests
GROUP BY DATEPART(month, Checkin)
)
SELECT NumOfDays, ByMonth FROM Served
WHERE ByMOnth = 12
D-ROP TABLE #Guests
Note :: The hyphens are added to some of the SQL keywords to avoid setting off my proxy server...
______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience