Results 1 to 2 of 2
  1. #1
    Join Date
    May 2012

    Unanswered: Calculate Hours Bonus

    hi guys.
    hmm, I'm from Brazil and my english is not the best but I would ask your help to solve a problem.
    I would like to calculate the value in sql command hours.

    Hours = 01:30:00
    vl_Time = $ 12.00

    bonus = $ 18.00

    Pliss, help me.

    The field Hours is of type time(6) without zone and the field vl_Time is of type numeric (10,2).


  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    what are the data types for hours and vl_time ?

    Assuming that hours is a timestamp data type, I would try something like:
    select hours, vl_time, date_part('hour', hours) * vl_time as bonus 
    from your_table
    where _____
    Last edited by loquin; 05-11-12 at 18:59.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

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