This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I am trying to add today's date to my output data in excel file. I see responses on here to tick the "Take File/Table Name from a field" then Append Suffix to File/Table Name and Today_date. I have done this also adding in the formula tool to add DateTimeNow() in my worksheet.
The above works for me on a CSV file, however, it doesn't when trying to change to xlsx
I have also tried to use the Render tool and this saves the file down with the date correctly but changes the format and removes half the data.
***Edit: BenMoss beat me to the punch. See his response above***
Can you give a little more detail about what you mean by "add today's date to my output data in excel file"? It sounds like you are trying to add the date to the end your output file name (as opposed to the sheet name). I think part of the reason Excel files can be tricky is that they have worksheet names that can get in the way of renaming, which is why you may have had success with .csv or other file types.
One relatively easy workaround could be creating a "File Name" field and then changing the drop drop down under "Take File/Table Name from Field" to "Change Entire File Path" with "File Name" selected. I used a formula tool to create the "File Name" field with a formula "C:\**your file path**\**your file name**" + [Date] + ".xlsx|||**your sheet name**". You could also add the datetimenow function into this formula but you'll probably need to include a datetimeformat function as well unless you want the time included as well as the date in your file name. I chose to have another formula with the datetimenow call.
Hopefully this helps, but let me know if you were asking a different question.
If i have to attach the latest file based on the date stamp how will the Email tool be configured for the same?
For example- i have a data extract file which needs to be sent out everyday with the date stamp in the file header , i was able to achieve the same using the answer above however if i have to send this file daily as an attachment then how will the email tool be configured?