This three columns are taken from 3 tables. In other words, these records are retrieved by joining 3 tables.
It is basically a very simple time sheet that keeps track of shift starts time, lunch time and so on.
I want these four records to show in one row, for example:
setDate --- ShiftStarted --- LunchStarted --- LunchEnded ---- ShiftEnded ----- TimeEntered
Note: discard TimeEntered column. I will deal with this later, once i know how to solve the above issue, it will be easy for me to handle the rest.
How can i do it?
Further Info - Here is my query:
SELECT TimeSheet.setDate, TimeSheetType.tsTypeTitle
FROM TimeSheet
INNER JOIN TimeSheetDetail ON TimeSheet.timeSheetID = TimeSheetDetail.timeSheetID
INNER JOIN TimeSheetType ON TimeSheetType.timeSheetTypeID = TimeSheetDetail.timeSheetTypeID
TimeSheet table consists of the following columns:
timeSheetID
employeeID - FK
setDate
setDate represents today's date.
TimeSheetType table consists of the following columns:
timeSheetTypeID
tsTypeTitle
tsTypeTitle represents shifts e.g. shift starts at, lunch starts at, shift ends at, etc.
TimeSheetDetail table consists of the following columns:
timeSheetDetailID
timeSheetID - FK
timeSheetTypeID - FK
timeEntered
addedOn
timeEnetered represents the time that employee set manually. addedOn represents the system time, the time that a record was inserted.