# Variable in filename

**URL:** <https://forums.toadworld.com/t/variable-in-filename/26861>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [September 25, 2013, 7:37am UTC](https://forums.toadworld.com/t/variable-in-filename/26861 "2013-09-25T07:37:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![odewaart](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@odewaart](https://forums.toadworld.com/u/odewaart)\
**Post date:** [September 25, 2013, 7:37am UTC](https://forums.toadworld.com/t/variable-in-filename/26861/1 "2013-09-25T07:37:14Z")

</div>

Hi, I'm using TOAD Data Point 3.3 Trial (this needs to work before I buy :-)) and have problems using a variable in export to Excel filename. I must be doing something terribly wrong:

 ![TOAD Data Point problem.png](https://global.discourse-cdn.com/quest/original/2X/f/faf3848c7f433b48d7bc30fe4fb210bfffac033e.png)

Any help would be highly appreciated!

---

<div class="post-metadata">

**Author:** ![alancounihan](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/alancounihan/32/31_2.png) [@alancounihan](https://forums.toadworld.com/u/alancounihan)\
**Post date:** [September 25, 2013, 7:48am UTC](https://forums.toadworld.com/t/variable-in-filename/26861/2 "2013-09-25T07:48:02Z")

</div>

Hi,

Can you use the check box for in your screenshot on the Data Export Wizard window to add date/time to filename? The check box is Add Date/Time suffix to filename?

Rather than using a variable?

Alan

On Wed, Sep 25, 2013 at 3:37 PM, odewaart [bounce-odewaart@toadworld.com](mailto:bounce-odewaart@toadworld.com) wrote:

> **[Variable in filename](http://www.toadworld.com/products/toad-data-point/f/36/t/20390.aspx)**

> Thread created by odewaart  
> Hi, I'm using TOAD Data Point 3.3 Trial (this needs to work before I buy :-)) and have problems using a variable in export to Excel filename. I must be doing something terribly wrong:

> Any help would be highly appreciated!

> To reply, please reply-all to this email.
> 
> [Stop receiving emails](http://www.toadworld.com/products/toad-data-point/f/36/t/20390.aspx?subscribe=false) on this subject.
> 
> Or [Unsubscribe from Toad Data Point - General](http://www.toadworld.com/products/toad-data-point/f/36.aspx?subscribe=false) notifications altogether.  
> Toad Data Point - Discussion Forum

> [Flag](http://www.toadworld.com/products/toad-data-point/f/36/t/20390.aspx?AbuseContentId=c993f44d-7294-47df-af6f-7aef123f6c80&AbuseContentTypeId=46448885-d0e6-4133-bbfb-f0cd7b0fd6f7&AbuseFlag=true) this post as spam/abuse.

> ![](https://global.discourse-cdn.com/quest/original/3X/5/0/50b30fd5f87c85fe5cba2635cb83316ca71250d7.gif)

---

<div class="post-metadata">

**Author:** ![odewaart](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@odewaart](https://forums.toadworld.com/u/odewaart)\
**Post date:** [September 25, 2013, 7:54am UTC](https://forums.toadworld.com/t/variable-in-filename/26861/3 "2013-09-25T07:54:01Z")

</div>

Hi Alan,

Thanks, I know that works BUT… I need to comply to ‘yyyy-mm-dd-hh-mm-ss’, note the hyphen between days and hours. Adding the standard date time gives me nearly what I need, but not exactly.

I’m trying to follow what Debbie described in her blog #12 but I can’t get it to work…

Onno

---

<div class="post-metadata">

**Author:** ![alancounihan](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/alancounihan/32/31_2.png) [@alancounihan](https://forums.toadworld.com/u/alancounihan)\
**Post date:** [September 25, 2013, 9:01am UTC](https://forums.toadworld.com/t/variable-in-filename/26861/4 "2013-09-25T09:01:03Z")

</div>

Hopefully this will work for you as it worked for me

Just place yyyy-mm-dd-hh-mm-ss in the date format field in the wizard ( see attached)

On Wed, Sep 25, 2013 at 3:54 PM, odewaart [bounce-odewaart@toadworld.com](mailto:bounce-odewaart@toadworld.com) wrote:

> **[RE: Variable in filename](http://www.toadworld.com/products/toad-data-point/f/36/p/20390/41429.aspx#41429)**

> Reply by odewaart  
> Hi Alan,

> Thanks, I know that works BUT.... I need to comply to 'yyyy-mm-dd-hh-mm-ss', note the hyphen between days and hours. Adding the standard date time gives me nearly what I need, but not exactly.

> I'm trying to follow what Debbie described in her blog #12 but I can't get it to work....

> Onno

> To reply, please reply-all to this email.
> 
> [Stop receiving emails](http://www.toadworld.com/products/toad-data-point/f/36/t/20390.aspx?subscribe=false) on this subject.
> 
> Or [Unsubscribe from Toad Data Point - General](http://www.toadworld.com/products/toad-data-point/f/36.aspx?subscribe=false) notifications altogether.  
> Toad Data Point - Discussion Forum

> [Flag](http://www.toadworld.com/products/toad-data-point/f/36/p/20390/41429.aspx?AbuseContentId=dad87c92-4bf7-4b3d-81c1-61db1595b8ce&AbuseContentTypeId=f586769b-0822-468a-b7f3-a94d480ed9b0&AbuseFlag=true) this post as spam/abuse.

>

---

<div class="post-metadata">

**Author:** ![alancounihan](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/alancounihan/32/31_2.png) [@alancounihan](https://forums.toadworld.com/u/alancounihan)\
**Post date:** [September 25, 2013, 9:24am UTC](https://forums.toadworld.com/t/variable-in-filename/26861/5 "2013-09-25T09:24:02Z")

</div>

Just reviewed this and Hyphen between days and hours is still missing ☹

Almost there but not quite

On Wed, Sep 25, 2013 at 5:01 PM, alancounihan [bounce-alancounihan@toadworld.com](mailto:bounce-alancounihan@toadworld.com) wrote:

> **[Re: Variable in filename](http://www.toadworld.com/products/toad-data-point/f/36/p/20390/41433.aspx#41433)**

> Reply by alancounihan  
> Hopefully this will work for you as it worked for me

> Just place yyyy-mm-dd-hh-mm-ss in the date format field in the wizard ( see attached)

> 

> On Wed, Sep 25, 2013 at 3:54 PM, odewaart [bounce-odewaart@toadworld.com](mailto:bounce-odewaart@toadworld.com) wrote:
> 
> > **[RE: Variable in filename](http://www.toadworld.com/products/toad-data-point/f/36/p/20390/41429.aspx#41429)**

> > Reply by odewaart  
> > Hi Alan,

> > Thanks, I know that works BUT.... I need to comply to 'yyyy-mm-dd-hh-mm-ss', note the hyphen between days and hours. Adding the standard date time gives me nearly what I need, but not exactly.

> > I'm trying to follow what Debbie described in her blog #12 but I can't get it to work....

> > Onno

> > To reply, please reply-all to this email.
> > 
> > [Stop receiving emails](http://www.toadworld.com/products/toad-data-point/f/36/t/20390.aspx?subscribe=false) on this subject.
> > 
> > Or [Unsubscribe from Toad Data Point - General](http://www.toadworld.com/products/toad-data-point/f/36.aspx?subscribe=false) notifications altogether.  
> > Toad Data Point - Discussion Forum

> > [Flag](http://www.toadworld.com/products/toad-data-point/f/36/p/20390/41429.aspx?AbuseContentId=dad87c92-4bf7-4b3d-81c1-61db1595b8ce&AbuseContentTypeId=f586769b-0822-468a-b7f3-a94d480ed9b0&AbuseFlag=true) this post as spam/abuse.

> >

> 

> **Attachments:**  
> [Capture.PNG](http://www.toadworld.com/cfs-file.ashx/__key/telligent-evolution-components-attachments/13-40-00-00-00-00-08-13/Capture.PNG)

> To reply, please reply-all to this email.
> 
> [Stop receiving emails](http://www.toadworld.com/products/toad-data-point/f/36/t/20390.aspx?subscribe=false) on this subject.
> 
> Or [Unsubscribe from Toad Data Point - General](http://www.toadworld.com/products/toad-data-point/f/36.aspx?subscribe=false) notifications altogether.  
> Toad Data Point - Discussion Forum

> [Flag](http://www.toadworld.com/products/toad-data-point/f/36/p/20390/41433.aspx?AbuseContentId=7fee1c53-d909-43b9-9931-f3ab5c21bcc7&AbuseContentTypeId=f586769b-0822-468a-b7f3-a94d480ed9b0&AbuseFlag=true) this post as spam/abuse.

>

---

<div class="post-metadata">

**Author:** ![odewaart](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@odewaart](https://forums.toadworld.com/u/odewaart)\
**Post date:** [September 25, 2013, 11:58am UTC](https://forums.toadworld.com/t/variable-in-filename/26861/6 "2013-09-25T11:58:33Z")

</div>

Yeah, tried that before.

But leaving the actual date format alone, I want to understand how I can use a variable in the file name, as described in Debbie’s blog.

Thanks for your efforts!

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [September 25, 2013, 1:32pm UTC](https://forums.toadworld.com/t/variable-in-filename/26861/7 "2013-09-25T13:32:59Z")

</div>

The Export Wizard does not support bind variables in the export path. Only the Select to File activity does. This is a feature we plan to add but it hasn’t been coded yet. You will need to use select to file activity OR use a copy/rename file activity after using the export wizard.

I added QAT-781 for this issue.

---

<div class="post-metadata">

**Author:** ![odewaart](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@odewaart](https://forums.toadworld.com/u/odewaart)\
**Post date:** [September 26, 2013, 12:14am UTC](https://forums.toadworld.com/t/variable-in-filename/26861/8 "2013-09-26T00:14:34Z")

</div>

Thanks Debbie! Using the Select to File activitiy I am indded able to use bind variables and now I get the filename I need. Excellent!

Problem solved. However...

I'm searching high and low but cannot find the Export options (available in Export Wizard and similarly shown in Debbie's blog #12) to set the worksheet name:

 ![Export Options in Wizard.png](https://global.discourse-cdn.com/quest/original/2X/a/a66b0b426b436069bb9b33f0e278fbc1ab9e3a51.png)

All I seem to have is this, no option to set the worksheet name:

 ![Select to File Options.png](https://global.discourse-cdn.com/quest/original/2X/9/9c9689e786592c34926eecdc1d5181f636a0a7ca.png)

I feel like I am asking silly questions but where can I find the Export Options? (this question also asked by elizabeth.wilsey\_828 on 2013-09-20)

Again, help is highly appreciated!

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [September 26, 2013, 7:32pm UTC](https://forums.toadworld.com/t/variable-in-filename/26861/9 "2013-09-26T19:32:38Z")

</div>

You are not asking a silly question. We took out this extra options in the select to file in version 3.3. You are not the only one that misses these options. We have a task to put these back in but it is not that easy and will not make this release. (QAT-556)

If you are an advanced user you might consider editing the Automation script manually. Open the tas file in notepad. Look for the “ExcelExportInstanceOptions” section. these are the options that go with the screenshot you are showing. They are still in the script but there is no UI for it anymore.

You can edit the script and export to a named worksheet by adding the attribute like below. Give that a try.

WorksheetName=“DATA”

\<ns1:ExcelExportInstanceOptions FileDirctory=“C:\Users\dpeabody\Documents\ToadExport.xlsx” FileName=“ToadExport” FileOverwrite=“True” xmlns:ns1=“clr-namespace:Quest.Toad.ImportExport;Assembly=ToadCore, Version=7.0.0.1819, Culture=neutral, PublicKeyToken=c862883b2ae69822”\>  
ns1:ExcelExportInstanceOptions.FormatSettings  
\<ns1:FormatSettings FormatType=“ExcelFile” ExcelAfterExportMacros="{x:Null}" QuoteChar="’" Column=“0” FolderImportDirectory="{x:Null}" BlockInsertValue=“500.0” HeaderBackColor=“LightGray” FileExtension=“xlsx” WorksheetName=“DATA” Row=“1” ExcelBeforeExportMacros="{x:Null}" FileFilter=“Excel (2007) Files (_.xlsx)|_.xlsx | Excel (_.xls)|_.xls” Delimiter="," ExcelAtLocation="{x:Null}" /\>  
\</ns1:ExcelExportInstanceOptions.FormatSettings\>  
\</ns1:ExcelExportInstanceOptions\>

---

<div class="post-metadata">

**Author:** ![odewaart](https://avatars.discourse-cdn.com/v4/letter/o/c5a1d2/32.png) [@odewaart](https://forums.toadworld.com/u/odewaart)\
**Post date:** [September 30, 2013, 1:36am UTC](https://forums.toadworld.com/t/variable-in-filename/26861/10 "2013-09-30T01:36:57Z")

</div>

Thanks Debbie.

Editing the script is far from beautiful, but it works! I’ll use that for my daily exports.

Cheers
