Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2008
    Posts
    1

    Unanswered: Seperating time field

    Hi guys, newb to PostgreSQL here.

    I have a table that stores data when a resource is accessed. Now I need to develop a query or queries that will give an hour by hour break down that shows how often such resource is accessed i.e.

    Time Hits
    12:00-13:00 20
    13:00-13:00 40
    14:00-15:00 30

    Now the only useful field for this that the table contains is a timestamp field with the format: YYYY-MM-DD HH:MMec.Milisec.

    So basically its got to look at this timestamp, extract the hour and add 1 to a hit field on a report I am generating through iReports.

    Thanks in advance for any help.

    Scott

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by Sscotthendo
    Now the only useful field for this that the table contains is a timestamp field with the format: YYYY-MM-DD HH:MMec.Milisec.
    A column of the datatype timestamp does not have a format.

    Quote Originally Posted by Sscotthendo
    So basically its got to look at this timestamp, extract the hour and add 1 to a hit field on a report I am generating through iReports.
    Without seeing the actual table definition it's hard to give any suggestion, but using the extract function you can retrieve the hour from a timestamp column.

Posting Permissions

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