Viewing 2 posts - 1 through 2 (of 2 total)
Try
ALTER TABLE table
ADD [Date] date;
go
UPDATE table
set [Date]= DateFromParts(cast([Year] as int), cast([Month] as int), 1);
/*
DROP COLUMN [Year], [Month];
*/
or
...
January 31, 2014 at 5:14 pm
#1685258
;with
T as (
SELECT VendorCode, 1 as Seq, UnitPrice, Qty, (UnitPrice * Qty) as Total
from Sales
union
SELECT VendorCode, 2, sum(UnitPrice), sum(Qty), sum(UnitPrice * Qty)
January 31, 2014 at 4:00 pm
#1685246