Re: [SQL] Count rows by day interval

2007-05-10 Thread chester c young
> ... instead of date_trunc('day',sent_messages.date) why don't you have a function that takes four three arguments: - beginning date of query - interval, ie, reminder_services.activity_days_min - timestamp, ie, sent_messages.date have it return the minimum date for that interval as I think I u

[SQL] Count rows by day interval

2007-05-10 Thread Loredana Curugiu
Dear all, I have the following 3 tables: TABLE 1: themes uid | theme -+ 1 | HOME 2 | BILL 3 | ERROR 4 | ACTION 5 | ANA 6 | LIA 7 | MIA TABLE 2: reminder_services uid | theme_uid | activity_min_days | activity_max_months -++