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 |
|
CLages
Posting Yak Master
116 Posts |
Posted - 2005-11-25 : 06:17:20
|
| HiI have a tabela Like thisDep Code Qty 001 123 12001 144 08002 123 50002 126 10002 144 30003 123 44003 ABC 12 I would like to get like this dep001 dep002 dep003 Code Qty Qty Qty Balance 123 12 50 44 106 126 0 10 0 10 144 8 30 0 38abc 0 0 12 12any help will be ApreciatedTks in Advance once moreCLages |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
CLages
Posting Yak Master
116 Posts |
Posted - 2005-11-25 : 06:38:48
|
| Yes, i found some good ideias herei choose this oneis there a better solution?TksAnywayClagesselect P.pro_codigo, P.pro_desc , P.pro_grupo, sum(case when P.pro_deposito = '001' then pro_saldo_fis1 else 0 end), sum(case when P.pro_deposito = '002' then pro_saldo_fis1 else 0 end) from produto p where P.pro_deposito = '001' or P.pro_deposito = '002' group by P.pro_codigo, P.pro_desc , P.pro_grupo |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-25 : 08:31:08
|
| Yes. Test it with large data and see the performance.Where do you want to show those data?MadhivananFailing to plan is Planning to fail |
 |
|
|
CLages
Posting Yak Master
116 Posts |
Posted - 2005-11-25 : 09:28:49
|
| This will be a SP called by Crystal ReportFor while is running OKtksC.Lages |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-25 : 09:30:09
|
| WellI think Crystal Reports supports Cross TabIf possible try that alsoMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|