April 27, 2010 at 1:51 am
Hello,
My name is najibullah. I have table of salary of staff i want caculate the salary of staff every month and every year i don't know the query
can i one help me in this query?
thanks
Najibullah Sherzad
April 27, 2010 at 5:57 am
not enough info;
you have a table with salaries, what does it contain? do you mean a base rate of pay? is it an hourly rate, so $10 dollars an hour, x 40 hours a week, or is it actual salaries, how much they make per week [or pay period] regardless of hours worked? does it containt the pay period length as well?
or does the table contain what they were actually paid previously, and you want to extrapolate?
the rest of all the calculations, monthly vs yearly, is just multiplication, but we need the structure of the data to give you a meaningful answer.
can you show us the CREATE TABLE statement, along with a couple of rows of INSERT INTO data of fake, example data?
do not give us real data, don't get yourself in trouble posting salaries of your coworkers on the interwebs
Lowell
April 27, 2010 at 6:29 am
one should know the business specifications or logic to implement the functionality of calculating the salary 😎
May 1, 2010 at 10:05 pm
Hello lowel brother,
My table stracture like that
create table salary(id int(9), name char(23), fathername char(23),
Salary number(12))
thanks,
Najibullah sherzad
May 2, 2010 at 2:36 am
Hello Najibullah,
You say you want to calculate the amount by month and year. I don't see any columns in your salary table with a reference to year and month. Or are they stored in the integer field 'salary-id' , and if so how ?
regards,
Cees
May 2, 2010 at 6:18 am
najib_sherzadd (5/1/2010)
Hello lowel brother,My table stracture like that
create table salary(id int(9), name char(23), fathername char(23),
Salary number(12))
thanks,
Najibullah sherzad
OK Najibullah; i noticed the Salary is datatyped as number(12), so i assume you are using Oracle? won't make a difference here, but remember this is a SQL oreiented forum; a lot of answers might be work only in SQL.
if that column has the weekly salary, why would it not be something as simple as this?
SELECT
ID,
NAME,
FATHERNAME,
SALARY,
SALARY * 4 AS MONTHLY_SALARY,
SALARY * 52 AS YEARLY_SALARY
FROM SALARY
Lowell
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply