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.

 All Forums
 Development Tools
 Reporting Services Development
 Choosing specific fields

Author  Topic 

Tart_SQL
Starting Member

41 Posts

Posted - 2008-04-08 : 14:39:14
Hello I really have not learnt VB.Net, in the below table:

T_awppl c_qrtD fir_Qrt sec_Qrt third_Qrt fourth_Qrt
Total 1Q08 2 0 0 0
Total 2Q08 0 3 0 0
Total 3Q07 0 0 0 0
Total 4Q07 0 0 0 7

I need to select c_qrt for the fileds fir_Qrt, sec_Qrt, third_Qrt,
fourth_Qrt that are not zero.

What Vb code do I use on the report level to have textboxes
display specific c_qrtD
for the valuse not zero, or is there any other way I can have this
done?

Also in sec_qrt where all values are zero. I want it to display
2Q08, do I need to use a function?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-09 : 12:27:15
=IIF( Fields!fir_Qrt.Value<>0 & Fields!sec_Qrt.Value<>0 & Fields!third_Qrt.Value<>0 & Fields!fourth_Qrt.Value<>0 ,Fields!c_qrtD.Value ,yourdefaultvalue)
provided you have all these fields available in your dataset
Didnt get your second question. do you mean the total of all sec_Qrt values?
Go to Top of Page

Tart_SQL
Starting Member

41 Posts

Posted - 2008-04-10 : 17:01:03
Sorry visakh16, I had not been able to respond early. What I want in this case is what you would do on T-SQL like this:

SELECT c_qrtD
FROM (below table)
WHERE fir_Qrt <> 0

I just need to know how you can do this with VB.Net on the report level. Thanks

Go to Top of Page

Tart_SQL
Starting Member

41 Posts

Posted - 2008-04-10 : 17:06:45
....Also is it possible to pick just the value in the second or third rows, just like you would if you use First or Last in VB.Net? In my table for 'third_Qrt' column all values are zero but I want to pick 3Q07 how do I go about that?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-11 : 13:17:40
For filetering out 0s you can add a filter to your tables. But still unsure what your exact requirement is. Can you post what is your expected report o/p out of data in first post.
Go to Top of Page

Tart_SQL
Starting Member

41 Posts

Posted - 2008-04-11 : 17:12:49
What is expected should be in this format


T. per Quarter 3Q07 4Q07 1Q08 2Q08
-----------------------------------------------------
T. Delivery 0 7 2 3

NB. The first line (T.per Quarter) should have each item in seperate textboxes. Thanks.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-12 : 04:38:24
Aha. So you want to cross tab your data. You can add a matrix with row group as items and column group as c_qrtD values and use SUM(fir_Qrt + sec_Qrt + third_Qrt + fourth_Qrt) as data.
Go to Top of Page
   

- Advertisement -