Results 1 to 3 of 3

Thread: Days between

  1. #1
    Join Date
    May 2004

    Unanswered: Days between


    I have a table with events, wich have a begin date and a end date. And now I have to point this dates in a calendar. If the events are a day only, no problem and I point that day.
    The problem is when the begin and end dates have more than a day between then. How can I have a select that gives me all the days in between so that I can point them in the calendar.

    Maby thanks.

  2. #2
    Join Date
    Mar 2004
    what you need to do is create a second table with a column for dates. It should include a row for each day of the year.

    You would then do a LEFT OUTER JOIN on this table and your current one and it would print out all the days in between your necessary start/end dates.

  3. #3
    Join Date
    May 2004
    I don't think that should resolve my problem, because I don't have a day to OUTER JOIN.

    I have something like this:

    SELECT * from events;

    event_id text begin_dt end_dt
    -------- ---- -------- -------
    15 xpto 2007-01-15 2007-01-25

    And I would like to have a result like this:

    event_id day month year
    -------- ---- ------ ----
    15 15 01 2007
    15 16 01 2007
    15 24 01 2007
    15 25 01 2007

    Last edited by xixo; 02-23-07 at 08:56.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts