I'm new to SQL server & am trying to use DTS to create what amounts to a crosstab query on a text file that I'm importing. I'm aware of having to use the CASE statement to get what I want under normal circumstances but what I need is unfortunately a bit more complicated than normal & I can't get it to work.
The temp table that I've created has the following fields with several transactional records per person per day -
Staff no. Data Date Work type Data1 Data2
123456 24/02/2005 A 1 0
123456 21/02/2005 B 0 1
123456 21/02/2005 B 1 0
123456 20/02/2005 C 0 1
The output that I want will be something like with one line per person per day
[Staff no.] [Data Date] [A Data1] [A Data2] [B Data1] etc (4 data types, 2 lots of data per type)
Anyone give me a pointer ?
Thanks
Steve
The temp table that I've created has the following fields with several transactional records per person per day -
Staff no. Data Date Work type Data1 Data2
123456 24/02/2005 A 1 0
123456 21/02/2005 B 0 1
123456 21/02/2005 B 1 0
123456 20/02/2005 C 0 1
The output that I want will be something like with one line per person per day
[Staff no.] [Data Date] [A Data1] [A Data2] [B Data1] etc (4 data types, 2 lots of data per type)
Anyone give me a pointer ?
Thanks
Steve