I like to return data from a query in a "horizontal" row.
Is it possible - more importantly is it worth the effort and overhead to
return data from a query in this format:
ID SUN MON TUES WED THUR FRI SAT
HOURS
As Opposed to:
DATE ID HOURS
My current query is:
SELECT DISTINCT TIMECARD.WORK_DATE, TIMECARD.EMPL_ID,
SUM(HRS_REC_NBR) AS HOURS
FROM TIMECARD
WHERE (DATEPART (wk, WORK_DATE) = 15)
OR (DatePart (wk, WORK_DATE) = 16)
AND (DatePart(yyyy,Work_date) = 1999)
GROUP BY EMPL_ID, WORK_DATE, EMPL_ID
ORDER By TIMECARD.EMPL_ID, TIMECARD.WORK_DATE
Where "HRS_REC_NBR" is the hours recorded for the day. The weeks picked
(15 and 16) will be two parameters passed into the stored procedure.
My gut instinct tells me it would be simple to handle the "horizontal"
layout in code (VB).
Any input would be much appreciated.