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!

FILE NAME

Status
Not open for further replies.

Mistral2

Technical User
Nov 12, 2002
21
TN
Hi Everyone,

I want to add the date of the day in the name of the file ( when i export file to Excel) I proceeded like follows:

use article
CFILE = " C:\tmp\article+CTOD(date ())"
COPY TO CFILE TYPE XL5
the result it is that the file carries the name c:\cfile.xls instead of c:\tmp\article21/05/2003

Thank you
Mistral






 
Try this:
cFile = "C:\tmp\article"+ctod(date())

Note that the date is after the Quotation ""

Copy to (cFile) type XL5 && excel file

Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
You may need a
STRTRAN(DTOC(DATE()),"/","-")

in there as a plain dtoc would provide 21/05/2003 and i think the "/" character is invalid in windows filenames.

mrF
 
TeknoSDS

cFile = "C:\tmp\article"+ctod(date())

This throws an error, but this does not:

cFile = "C:\tmp\article"+dtoc(date())

Or better still:
cFile = "C:\tmp\article"+dtos(date())

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike.. you're right...

I meant dtoc() instead of ctod()... ....

Thanks for the correction!!!



Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
A key point, implicit in Ali's example, is that you need to say

COPY TO (CFILE)...

rather than

COPY TO CFILE...

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top