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
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Padding left on a report Parameter?

Author  Topic 

CoachBarker
Posting Yak Master

170 Posts

Posted - 2009-04-03 : 14:50:37
Is there a way to pad left one of the values in a report parameter, say I have the number 10731 but the db is going to be looking for a 6 digit number 010731. Can I access the properties of the parameter in the report itself or the query.

If not is there a way to pad left the parameter in the query? Padding left @customer_bill_to and @customer_delv_to

WHERE (detail_record.pickup_date >= @start_date) AND (@customer_bill_to IS NULL) AND (@customer_delv_to IS NULL) AND
(detail_record.pickup_date < DATEADD(day, 1, @end_date)) OR
(detail_record.customer_bill_to = @customer_bill_to) OR
(detail_record.pickup_date >= @start_date) AND (@customer_bill_to IS NULL) AND (detail_record.pickup_date < DATEADD(day, 1, @end_date)) AND
(detail_record.customer_delv_to = @customer_delv_to) OR
(detail_record.pickup_date >= @start_date) AND (detail_record.pickup_date < DATEADD(day, 1, @end_date)) AND
(detail_record.customer_bill_to = @customer_bill_to) AND (detail_record.customer_delv_to = @customer_delv_to)

If so it would make my life mmuch simpler.
Thanks for the help
CoachBarker

QAZAFI
Yak Posting Veteran

50 Posts

Posted - 2009-04-06 : 16:14:36
Hi There
I could not actually understand your question. To me it is very simple. If you are using stored Procedure then just you can write
"0"+Convert(varchar(6),@customer_delv_to) if ),@customer_delv_to=10731 then and it will give you
010731
sorry if i misunderstood your question
thanks
Qazafi
Go to Top of Page

QAZAFI
Yak Posting Veteran

50 Posts

Posted - 2009-04-06 : 16:16:12
Hi There
I could not actually understand your question. To me it is very simple. If you are using stored Procedure then just you can write
"0"+Convert(varchar(6),@customer_delv_to) sorry i put bracket in my previous post
if @customer_delv_to=10731 then and it will give you
010731
sorry if i misunderstood your question
thanks
Qazafi
Go to Top of Page
   

- Advertisement -