Re: [SQL] generate a range within a view

2013-10-10 Thread Gary Stainburn
I've managed to do it using a function, shown below, but is there a better way? create type site_user_department_limits as (s_id char, de_id int4, date date, day_id_week int4, day_limit); create or replace function site_user_department_limits(date,date) returns setof site_user_department_l

[SQL] generate a range within a view

2013-10-10 Thread Gary Stainburn
I have two tables, one defining a standard week by user department, the other defining a calendar where specific dates can deviate from the standard. The tables are shown below. I'm trying to generate a view where I can do select * from user_department_daily_limits where de_date >= '2013-10-06'