Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2001
    Posts
    1

    Unanswered: Date arithmetic issues....

    I'm trying to return date parts from a SQL-derived date string.... the SQL for the date-difference:

    SELECT now() - min(start_raw) AS diff FROM event_view WHERE appointment_id=1175 produces: '1 day 19:06'

    Now, I want to take date/time parts from this string BUT I want to do something like: date_part('day', INTERVAL (SELECT now() - min(start_raw) AS diff FROM event_view WHERE appointment_id=1175)); or some such thing. However, I keep getting errors no matter how I try to cast this, quote it, etc.

    Anyone else deal with such issues?

  2. #2
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    Date part

    There are some functions in the postgresql db itself.

    There is a good FAQ:

    DATE-TIME FAQ

    Or try the datecalc module from Perl
    you can find this under CPAN

    Eperich
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

Posting Permissions

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