Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2011

    Question Unanswered: date fields in postgreSQL (DAY, MONTH, YEAR)


    I want to select day, month and year out of a date field in PostgreSQL.

    The field is datecalc.

    I moved this query from MS SQL Server to Postgres so I could access the right table.

    Here is the query? does anyone know how I can change this to work?

    select, l.primaryname, DAY(lp.calcdate) as day, lp.popularity, lp.categorypopularity
    from t_location l left join
    t_location_popularity_history lp on
    where YEAR(lp.calcdate)=2011 and in (1818266,
    group by, l.primaryname, DAY(lp.calcdate), lp.popularity, lp.categorypopularity

  2. #2
    Join Date
    May 2008
    Use the EXTRACT function.

Posting Permissions

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