if object_id('tempdb.dbo.#temp') is not null drop table #temp
create table #temp
(
dateValue datetime,
category varchar(3),
amount decimal(36,2)
)
insert into #temp values ('1/1/2012', 'ABC', 1000.00)
insert into #temp values ('2/1/2012', 'DEF', 500.00)
insert into #temp value...