-
Jan 3rd, 2018, 05:05 AM
#1
Thread Starter
Member
[RESOLVED] Check If Date is between period and do calculations
Hello,
I have a Table in SQL DB called VNewEntries and the columns are: ID, EmpNo, AppointmentDate, VFrom, VTo, VBasicSalary, VAllowances, DeservedBalanceDays, DeservedBalanceKD.
What I want is to check if the AppointmentDate is between VFrom and VTo and do some calculation to get the DeservedBalanceDays then another calculation to calculate DeservedBalanceKD.
For Example:
Employee has EmpNo 3 and his AppointmentDate is 2018-02-15
VFrom is 2018-02-01
VTo is 2018-02-28
DeservedBalanceDays will be VTo - AppointmentDate +1
DeservedBalanceKD will be (DeservedBalanceDays / 26) * (VBasicSalary + VAllowances)
This will be if the AppointmentDate is between VFrom and VTo, if not he will get 2.5 in DeservedBalanceDays.
Thanks in advance.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|