all groups > sql server reporting services > february 2006 >
You're in the

sql server reporting services

group:

using calulated number in report


using calulated number in report Bill
2/6/2006 1:48:52 PM
sql server reporting services: I need to count the number of row returned on the query
@@rowcount would seem to work
But I need to be able to use this number in the report
How do I turn this is to a useable Field???

sorry Im no delevoper, Im sure it's easy but Ive hacked a round a bit and
still NG

thanks
Re:using calulated number in report saras
2/6/2006 11:55:56 PM
If u r using Table in ur report, then the following calculation will help u
out:

=Count(<field_name>.value, "<table_name>")

Regards,
Re:using calulated number in report Bill
2/7/2006 8:54:39 AM
ok, I should have been more detailed
the query I am using references 2 tables
it then uses a where A=B
so my result is information from both tables

so I do not think I could just reference one table as you indicate.

I have gooten the result in regular query anaylizer with select @@rowcount
how can I do the similar and then use the result in my report
I need to disply this number AND I then need to do some math against it to
generate other number and statistics

I'll paste in my query belo
-------------------------------------------------------------------------------------
SELECT shp_hedr.order_no, shp_hedr.order_dt, shp_hedr.cust_no,
shp_hedr.st_name,
shp_hedr.cust_po, shp_hedr.ship_date, shp_hedr.inv_no, shp_hedr.inv_date,
shp_detl.manu_no, shp_detl.item_no, shp_detl.due_date, datediff(day,
ship_date, due_date) AS Days

FROM DB01.dbo.shp_detl shp_detl, DB01.dbo.shp_hedr shp_hedr

WHERE shp_detl.ship_no = shp_hedr.ship_no
AND ((shp_hedr.ship_date>=@FromDt
And shp_hedr.ship_date<=@ToDt))

order by days

select @@rowcount -- me trying to get the number..n
-----------------------------------------------------------------------------------------


[quoted text, click to view]
Re:using calulated number in report Bill
2/7/2006 1:26:29 PM
ok got it with this
=Count(Fields!Days.Value, "db01")let me ask you about embedded Iif

some of the numbers in the column which is being counted could be negative
I would also like a count of those negative numbers

I tried something like
=Iif(Fields!Days.Value < 0, =(Count(Fields!Days.Value, "db01")), "")to get
my count of negative number Didn't work
clue me in?

thx
bill


[quoted text, click to view]
Re:using calulated number in report saras
2/8/2006 12:00:00 AM
U need to write custome code to get the count of negative numbers.
If u find any other way then lemme know.

Regards,
Re:using calulated number in report Bill
2/8/2006 11:20:28 AM
Im not code hound or developer and it's been a long time since I wrote any
code.
Do you know of anywhere I can get a clue on this?

I know I need to likely come up with two varibles say
one for days less -7 ..call it dayl
one for day's between 0 and -7 cal it dayb

and then I need to count those that fit the two critiria and display them

so likely I need something logically like

If Days < 0 and Days > -7 then dayb=dayb + 1
If Days < -7 then dayl=dayl + 1

then I would display dayb and dayl

but no clue how Id do this in report services in the report with the VB .Net
code

ideas?

thanks
bill



[quoted text, click to view]
AddThis Social Bookmark Button