Basically, I have two columns i shall be working with..
First column is SalaryAmount, then the second column is AmountPerHour. Now SalaryAmount is an int and AmountPerHour is a decimal.
But the AmountPerHour is based on the calculation of the SalaryAmount for example...
Here is the SQL query i have for the AmountPerHour..
UPDATE Salary SET SalaryAmount=@SalaryAmount,
AmountPerHour= round((@SalaryAmount / 52 /48), 2, 4)
But the real answer should be 12.02, but it comes out as 12.00. Not im not sure if this is because of the rounding. or because of the fact that you can't calculate an int number and want it to come out as a decimal?
So my question, is that is there a way where i can convert the SalaryAmount to a decimal just for one query, and then change it back at the end? Therefore the calcuation is done correctly and the number isnt rounded off.
Please dont say change the salaryamount to decimal altogether because that messes alot with the code i have from other projects as they all use the same database.