Hi,
Got the following issue at hands...
STH Standard Hours is the normal working time for an employee and is calculated by
HoursWorked - BaseHours e g 12-8 = 4 hours overtime, however if
HoursWorked - BaseHours e g 3-8 = -5 hours negative overtime which might cancel out legitimate overtime
HSQL does not seem to have some kind of IIF function, so how can one tell the db if the HoursWorked are less then the prescribed BaseHours to return a 0 for this particular row.
Anyone struck something similar?
[Solved] Maths or Logical Issue
[Solved] Maths or Logical Issue
Last edited by gkick on Sun Dec 22, 2019 5:01 am, edited 1 time in total.
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
Re: Maths or Logical Issue
You can use a CASE WHEN statement
Code: Select all
CASE WHEN HoursWorked < BaseHours THEN 0 ELSE HoursWorked - BaseHours END
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Maths or Logical Issue
Thanks a lot, made my day !
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend