1

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

Trang Le
  • 87
  • 1
  • 9

2 Answers2

1

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
Hannover Fist
  • 10,393
  • 1
  • 18
  • 39
1

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

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77