At 09:26 AM 10/3/2009, Mike Epstein wrote:
Having a blurb and maybe some on can help.
SET VAR VFNM TEXT = ((CTXT(.VSTDT)+'-'+(CTXT(.VTHRDT)+'.XLS')))
I would like a variable to be the filename using two dates
PRINT EMPPYSM2V2s1a WHERE enddate >= .VSTDT and enddate <= .VTHRDT +
OPTION XLS +
|FILENAME NEW.XLS + How would I express the variable here?
|SHOW_CANCEL_DIALOG OFF +
|ALL_TEXT_IN_GENERAL_FORMAT off +
|CELL_ATTR On +
|INCLUDE_IMAGES OFF +
|INCLUDE_LINES OFF +
|INCLUDE_RICH_TEXT On +
|RICHTEXT_ENCODING_TYPE IMAGE +
|INCLUDE_SHAPES OFF +
|LINE_SPACE ACTUAL +
|ONE_SHEET_PER_PAGE ON +
|OPEN ON
Mike,
Here's how:
First, define a file name using the FORMAT function to concatenate a
text string.
-- Example (Define a dynamic file name with extension based on start/end dates)
-- Define the first date of the current month
SET VAR vStartDate DATE = (RDATE((IMON(.#DATE)),1,(IYR(.#DATE))))
-- Define the last date of the current month
SET VAR vEndDate DATE = ((ADDMON(.vStartDate,1))-1)
-- Concatenate both variables along with the file extension as file name
SET VAR vFileName TEXT = +
((FORMAT(.vStartDate,'MMDDYYYY'))+'_'+(FORMAT(.vEndDate,'MMDDYYYY'))+'.XLS')
-- Now, use the following command to print the report as XLS
CLS
PRINT EMPPYSM2V2s1a WHERE EndDate BETWEEN .vStartDate AND .vEndDate +
OPTION XLS +
|FILENAME .vFileName +
|SHOW_CANCEL_DIALOG OFF +
|ALL_TEXT_IN_GENERAL_FORMAT OFF +
|CELL_ATTR ON +
|INCLUDE_IMAGES OFF +
|INCLUDE_LINES OFF +
|INCLUDE_RICH_TEXT ON +
|RICHTEXT_ENCODING_TYPE IMAGE +
|INCLUDE_SHAPES OFF +
|LINE_SPACE ACTUAL +
|ONE_SHEET_PER_PAGE ON +
|OPEN ON
Note:
In your case, substitute both vStartDate & vEndDate variables accordingly.
Should you require more examples or a different logic to achieve your goal,
feel free to contact me.
Very Best R:egards,
Razzak.
--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]
(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================