Re: View challenge



frebe73@xxxxxxxxx wrote:
I have a number of tables as below:
employee(*employeeid, ....)
schedule(*scheduleid, recur_interval, ...)
emp_schedule(*employeeid, *scheduleid, *valid_from, valid_to)
workshift(*scheduleid, *shiftid, starttime, endtime)

recur_interval indicates the number of days for which the schedule
should recur.
starttime and endtime indicates the first occurrence of the workshift.

Now I want to create a view (without using stored procedure) that
returns every occurrence of the workshifts for every employee, like
below.

create view emp_calendar as
select
employeeid,
starttime,
endtime
.....

Does someone has a solution (preferably MySQL) for this, or is it
simply impossible?

I suspect you left out a few details from your question. For instance, it appears a natural join on emp_schedule and workshift suffice for your view.
.



Relevant Pages

  • Re: Query - Calulations
    ... return the running time, up to now, if endTime is null, but startTime is ... > I have a small employee database that tracks time away from the ... If "Out all Day" is selected then the start and end time fields are ...
    (microsoft.public.access.queries)
  • Re: Problem with using Format( ) function on 1.25
    ... >The 2 variables starttime and endtime take values from cells in the ... >of my sheet and repeats for every employee for every day of the week ... My guess is that there is something funny about the data in 'endtime'. ... Is that a computed value or do you enter it into the cell directly? ...
    (microsoft.public.excel)
  • View challenge
    ... starttime and endtime indicates the first occurrence of the workshift. ... returns every occurrence of the workshifts for every employee, ...
    (comp.databases.theory)
  • RE: Add new tables to database
    ... If an employee can work in more than 1 area in the same day, then they can probably work in an area more than once in the same day. ... I'd remove tblAssignments.numAssignmentHours and replace it with columns for StartTime and EndTime. ... Jay ...
    (microsoft.public.access.tablesdbdesign)
  • RE: calculating difference between date/time fields
    ... Function BusinessHours(StartTime As Date, Endtime As Date) ... Dim DiffTime As Double ... If Endtime < StartTime Then ...
    (microsoft.public.excel.programming)

Loading