Answer by Beandon10
If you don't need the separate dates in columns, you could write the query as: DECLARE @Emp TABLE ( EmpID INT, hist_date DATETIME ) INSERT @Emp(EmpID, hist_date) VALUES (132, '7/1/2012'), (143,...
View ArticleAnswer by Kevin Feasel
This is a two-step problem that you can solve with ROW_NUMBER. Here's a sample solution: declare @table table ( empid int, hist_date date ); insert into @table(empid, hist_date) values (132,...
View ArticleAnswer by Tim
Try adding a group by. Without a dataset in front of me I would try a group by month(hist_date)
View ArticleAnswer by Beandon10
If you don't need the separate dates in columns, you could write the query as: DECLARE @Emp TABLE ( EmpID INT, hist_date DATETIME ) INSERT @Emp(EmpID, hist_date) VALUES (132, '7/1/2012'), (143,...
View ArticleAnswer by Kevin Feasel
This is a two-step problem that you can solve with ROW_NUMBER. Here's a sample solution: declare @table table ( empid int, hist_date date ); insert into @table(empid, hist_date) values (132,...
View ArticleAnswer by Tim
Try adding a group by. Without a dataset in front of me I would try a group by month(hist_date)
View Article