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 |
|
khufiamalik
Posting Yak Master
120 Posts |
Posted - 2008-10-27 : 02:52:50
|
| Hello All,I have a problem in Sql Query.I have Amount filed , when I Do query on that field ,it gives the right value which is 3.2097.when I use the same query in Sp and assign the result in a variable(in my SP) then it shows 3.21 I just want to get the original value.Can any one help meQuery is like'Select Amount from Employee where ID=1' result = 3.2097AND Query in SP is like Declare @lLocalVar as MoneySelect @lLocalVar=Amount from Employee where ID=1Result =3.21 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-27 : 02:55:57
|
| duplicatehttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=113321 |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-27 : 03:08:11
|
| Whats the datatype of Amount? is it also money? |
 |
|
|
khufiamalik
Posting Yak Master
120 Posts |
Posted - 2008-10-27 : 03:52:48
|
| Yes it is also Money |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-27 : 04:02:50
|
| And i assume you're using same query and not doing any other operations or using it as part of some other query. |
 |
|
|
khufiamalik
Posting Yak Master
120 Posts |
Posted - 2008-10-27 : 05:21:14
|
| No I have been running the same query as mentioned in my Mail. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-27 : 06:21:01
|
it looks fine to me on runningdeclare @m moneyselect @m=3.2097select @moutput--------------------------3.2097 |
 |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2008-10-27 : 06:49:45
|
| Would it be possible to post the whole code of the sp? There may be some implicit conversion taking place that you're not aware of.Regards,-------------Charlie |
 |
|
|
|
|
|