question

shsu avatar image
shsu asked

I have a report which will pull the data from this stored procedure.But dropdownlist in the report is showing NULL in the middle of other datas(Alphabetical order).I want NULL as first value in the drop downlist(so that easy for selecting)

I have a report which will pull the data from this stored procedure -- Insert statements for procedure here SELECT Empname FROM EmpComp UNION SELECT ('NULL') AS Empname The values are returned correctly. But dropdownlist in the report is showing NULL in the middle of other datas(Alphabetical order).I want NULL as first value in the drop downlist(so that easy for selecting).This stored prcedure is connected to a dataset(in report) which have one parameter (Empname). How can I amend above code for that? Thanks
stored-proceduressql server
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
anthony.green avatar image
anthony.green answered
Would need to add in some sort of custom ordering, something like the below SELECT Empname, ROW_NUMBER() OVER (ORDER BY Empname) AS RowNum FROM EmpComp UNION SELECT ('NULL') AS Empname, 0 AS RowNum ORDER BY RowNum Then get the parameter to only read the Empname column from the sproc
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.