SSRS Dynamic Subscription - how to use parameter in file name

1.7k Views Asked by At

How do I write the FileName to show 'Name ' + DespatchFrom + '-' + DespatchTo as FileName

Those values are parameters but I keep getting validation errors.

I have also tried 'Name ' + DateAdd(DateInterval.Day, 1-WeekDay(Today), Today()) as FileName enter image description here

2

There are 2 best solutions below

1
On

Unless your date fields are in already a text field, you'll need to convert them otherwise you'll get a conversion error.

Conversion failed when converting date and/or time from character string.

The Data Driven query needs SQL syntax which is why your second attempt with TODAY failed.

I think you want something like

SELECT 'Name ' + CONVERT(CHAR(10), DespatchFrom, 110) + ' - ' + CONVERT(CHAR(10), DespatchTo, 110)  as FileName
0
On

you don't need data driven .. you only want to add the date end of file name. you can use parameter @timestamp

enter image description here