Toad World® Forums

Date variable value in automation email subject in wrong format

I reviewed the using variables tutorial, and think I have eveyrthing set correctly. When my variable is set, it shows as mm/dd/yyyy but when it comes out on me email it is showing as "To_date(‘07/28/2014 00:00:00.00’, ‘MM/DD/YYYY HH24:MI:SS.SS’).

I am trying to include yesterday’s date in the subject line of the email.

I am using a SQL Server connection; my variable name is YDay; the variable type is SQL; the stmt is: select cast(convert(varchar(8),DATEADD(d,-1,getdate()),1) as date)"; the email subject line is: Comcash Invoices for #YDay#

My results are: Comcash Invoices for To_date(‘07/28/2014 00:00:00.00’, ‘MM/DD/YYYY HH24:MI:SS.SS’)

How do I get rid of this ugly format and get it pretty again?

TIA, Marge

You have it right. This looks like a bug. I entered QAT-3599 although I don’t think it will make the TDP 3.6 release.

As a work around change to string type var and use the built in functions like shown below.

ndate.png