Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
saba9
Starting Member
4 Posts |
Posted - 2010-05-26 : 13:38:34
|
| Hi, Im not sure if this questions comes in this topic or not. I'm having a hard time calculation per diem formula ( I work in banking industry) so anyone here knows how to calculate it, please help. ThanksCASE WHEN ratemethod = 'split' AND ((round(balance, 2,1) * -1) > lev2) THEN ((((round(balance,2,1) * -1) - lev2)* ((POWER((1+ CAST(rate2/100 AS float)),0.083333)-1))*12 /365) + (CAST(lev2 AS money) *((POWER((1+ CAST(rate1/100 AS float)),0.083333)-1))*12) / 365)ELSE (((round(balance,2,1) * -1) * ((POWER((1+ CAST(rate1/100 AS float)),0.083333)-1))*12) / 365) END perdiemI used round shouldve used decimal here, but i can change that, this formula does not give me correct result. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-05-26 : 14:52:36
|
* 12.0 / 365.0Beware of integer division N 56°04'39.26"E 12°55'05.63" |
 |
|
|
saba9
Starting Member
4 Posts |
Posted - 2010-05-27 : 08:39:29
|
| Please someone solve this problem. This is the 2nd forum I have posted this question and there is no one knows :/@Peso: I will fix that error..Thanks |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-27 : 09:06:43
|
1. Maybe Peso's correction is already the solution?2. If no one can solve your problem then maybe because of missing some information?You have stated: "this formula does not give me correct result"So I think you are able to say what is the expected result.Input / Processing / OutputYou can give InputYou can give wanted OutputWith this information then maybe we can fix the Processing No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2010-05-27 : 09:47:33
|
| Follow the HOW TO ASK link in my signature, and restate your problem after supplying the data we need to help. The link will show you how to supply the data.http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
|
|
|
|
|