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 |
|
s0ftw4r32002
Starting Member
6 Posts |
Posted - 2008-08-27 : 02:29:28
|
| I use data type float on tableDECLARE @fqty floatDECLARE @fnilai floatSELECT (fjmlawalbln +(SELECT isnull(sum(fqty * fhpp), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe < '11') -(SELECT isnull(sum(fqty * fhpp), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe >= '11')),(fqtyawalbln +(SELECT isnull(sum(fqty), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe < '11') -(SELECT isnull(sum(fqty), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe >= '11')),(fjmlawalbln +(SELECT isnull(sum(fqty * fhpp), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe < '11') -(SELECT isnull(sum(fqty * fhpp), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe >= '11'))/(fqtyawalbln +(SELECT isnull(sum(fqty), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe < '11') -(SELECT isnull(sum(fqty), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe >= '11'))from tblmmsaldo where ckode = '101.011-01' and cgendata = '0706'set @fqty = (SELECT fqtyawalbln +(SELECT isnull(sum(fqty), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe < '11') -(SELECT isnull(sum(fqty), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe >= '11')from tblmmsaldo where ckode = '101.011-01' and cgendata = '0706')set @fnilai = (SELECT fjmlawalbln +(SELECT isnull(sum(fqty * fhpp), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe < '11') -(SELECT isnull(sum(fqty * fhpp), 0) FROM tblmmtrn_dtl where ckode = '101.011-01' and ctipe >= '11')from tblmmsaldo where ckode = '101.011-01' and cgendata = '0706')select @fnilai / @fqtythe result result : 0.40569108320691 --> not goodif i type in sql query with the query :select 26491627.7334113/65300000result : 0.405691083206911the result is okplease help me. thank you |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-08-27 : 02:41:05
|
How many times do we have to tell you that FLOAT IS APPROXIMATE? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-27 : 02:42:09
|
| This is third consecutive thread in which you're asking the same thing. Cant you try out the solutions suggested? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-08-27 : 03:02:36
|
[code]select count(*)from threadwhere thread_id in (109551, 109552, 109558)and reply like '%APPROXIMATE%'[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
joe.inom
Starting Member
9 Posts |
Posted - 2008-08-27 : 04:24:14
|
| Hey , that is embarrising , if he had asked the stuff for many times , let him , until h e is clear for the fact , try to explain him.it is like i aint got no idea on the topic ,but you see that is quite insulting to be said that " ou have asked this trice !!! "San Diego Home Insurancejoe Alexender |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-27 : 04:27:26
|
quote: Originally posted by joe.inom Hey , that is embarrising , if he had asked the stuff for many times , let him , until h e is clear for the fact , try to explain him.it is like i aint got no idea on the topic ,but you see that is quite insulting to be said that " ou have asked this trice !!! "San Diego Home Insurancejoe Alexender
But we had clearly suggested the solution on previous occasions, somehow he doesnt seemed to have tried them and understood what we've suggested. |
 |
|
|
|
|
|
|
|