I am working on a query to produce a CSV file for importing into a payroll system and the file requires fixed literal values in the first three rows.
The first 3 rows should look as follows ( | indicates where column begins / ends) ....
< DEFN > |
< EMPID > | < COSTCEN >
< DATA > |
... then the data follows as below...
001 | 3.5 | 8.5
002 | 8 | 12
003 | 10 | 3
I tried a union but realised that the data types needed to match in each section. Of course this was not the case due to the hours being REAL data types.
Here is an sample of the type of data I am dealing with. Any help would be appreciated.
DECLARE @MyTable TABLE (EmployeeID VARCHAR(10), Hours1 REAL, Hours2 REAL)
INSERT INTO @MyTable
'001', 3.5, 8.5
'002', 8, 12
'003', 10, 3