Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS first function automatically added

I'm using SSRS in SQL Server 2008 with Report Builder 3.0 and was wondering, when I add a field on my report from a dataset, why does it automatically add the First() function to it ? Instead of adding [Field] in a text box, it adds =First(Fields!Field, "Dataset")

like image 734
Anth0 Avatar asked Jun 19 '26 14:06

Anth0


1 Answers

Datasets are assumed to always be multiple rows (even though that may not always be the case). So when you drag a field to a report object that isn't meant for multiple rows - such as a textbox - SSRS needs to use an aggregate function of some sort, so that if multiple rows do come back from the dataset, the report doesn't break (since that textbox isn't made to automatically repeat itself for every row).

FIRST is chosen simply because it's least destructive; it could just as easily be SUM, AVG, or any other aggregate function.

like image 138
kyzen Avatar answered Jun 22 '26 22:06

kyzen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!