Toad World® Forums

How to Email with Attachments and have the "current" Date files pull and show (6.5 version)

I am asking if functionality from Toad for SQL Server 5.8 transferred over to 6.5 version and if so, what the new syntax might be.

In version 5.8, I had an Automation Script that created an email and the title of the Email was:

Facility Daily Report for #yyyy-MM-dd#

This would automatically add the current date in that format to the email being sent (subject line would read: Facility Daily Report for 2016-10-06). In version 6.5, this syntax is not recognized; although, I did see it as Date(‘YYYY-MM-DD’) somewhere. I’ve tried all versions of the Date(‘YYYY-MM-DD’) and cannot get this to work. Are we still able to do this in version 6.5? If so, how?

Also, in adding an attachment, I used to use the same syntax (#yyyy-MM-dd#) to have Toad pull file with the latest date. This is no longer recognized in version 6.5. I am assuming if it is still a function in 6.5, it can be done in both the subject line as well as the attachments section.

Any help is GREATLY appreciate!

Thank you.

Hi Kmujeyi,

I'm running v6.7 and this is how I was able to do it using the variable feature in the Automation Designer.

Before the Email node in the Automation Designer, add a Set Variable node from the toolbox. In my screenshot, I called the variable myvar, I make it a string type, and I use the Date('YYYY-MM-DD') function to store the date formatted like I have in its parameter.

Now to use the variable in the email subject line put in: Facility Daily Report for #myvar#

You can use #myvar# in file names too, or you can use the dialog of the Select to File node, to select the date function:

Hope that helps!

Hello Mathew,

Thank you so much, this worked perfectly and resolved my issue in 6.5 as well!

Thank you again!