Solved

# how to find due date

Posted on 2011-03-15
371 Views
Dear all
In my employee data i have the following
joindate, basic salary. After every year from join date i have to pay one basic salary along with the monthly salary.

When preparing the monthly salary, what is the best method to  find out which are the people basic salary is due on that particular month.

0
Question by:bmkdubai
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 500 total points
ID: 35136603
I would start to compare:
to_char(sysdate, 'MM') = to_char(joindate, 'MM')

it could be +- 1 month (cf add_months function) ...
note that to_char returns a string, and not a number ...
0

LVL 28

Expert Comment

ID: 35136606
months_between(trunc(sysdate),join_date) in (12,24,36,48,60...) >=  then pay one more month basic sal along with the salary.

There are many ways to do this. That is just one method.
0

LVL 32

Expert Comment

ID: 35138324
where mod(months_between(trunc(sysdate,'mm'),trunc(joindate,'mm)),12) = 0
0

LVL 32

Expert Comment

ID: 35138377
Missing a quote -
where mod(months_between(trunc(sysdate,'mm'),trunc(joindate,'mm')),12) = 0
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

### Suggested Solutions

Sybase and replication server 13 79
join a table with user_tab_columns in oracle 3 79
replicate in oracle 13 42