Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying to a dynamically named Excel File 1

Status
Not open for further replies.

MMund

Programmer
Oct 9, 2007
57
CA
I am building a cursor with a SQL query and then exporting its contents to an Excel file with a name that will consist primarily of the system date, to wit:
'E'+RIGHT(DTOS(DATE()),6)

I also need to copy this file to a specific directory, but when I attempted to use this command:

COPY TO ../../monitor/'E'+RIGHT(DTOS(DATE()),6) TYPE XLS

I get the Unrecognized Command error. Any ideas as to how I could accomplish this?

Thanks in advance

 
store "../../monitor/E"+RIGHT(DTOS(DATE()),6) to lcFileName
copy to (lcFileName) type xls
 
or
COPY TO ('../../monitor/E'+RIGHT(DTOS(DATE()),6)) TYPE XLS

Tomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top