Toad World® Forums

Use Variable for file selection in Import Template

Hello, is it possible to use a variable in a import template to dynamically select a file that changes names every week?

Variable set via the following select statement:

SELECT 'c:'
+ CONVERT(VARCHAR(4),YEAR(DATEADD(wk, 0, DATEADD(DAY, 0-DATEPART(WEEKDAY, GETDATE()), DATEDIFF(dd, 0, GETDATE())))))
+ '-' + right('00'+CONVERT(VARCHAR(2),(MONTH(DATEADD(wk, 0, DATEADD(DAY, 0-DATEPART(WEEKDAY, GETDATE()), DATEDIFF(dd, 0, GETDATE())))))),2)
+ '-' + right('00'+CONVERT(VARCHAR(2),(DAY(DATEADD(wk, 0, DATEADD(DAY, 0-DATEPART(WEEKDAY, GETDATE()), DATEDIFF(dd, 0, GETDATE())))))),2)
+ ' Data.xlsx';

Don't think this is possible at the moment, although I can see it as being a good enhancement suggestion... It's worthy of putting on the Idea Pond.