At 02:30 PM 2/16/2009, James Bentley wrote:

Razzak,
I did a slight modification to you example:
SET VAR vFileName = ((CVAL('DATABASE'))+'_'+(FORMAT(.#NOW,'YYYYMMDD_HHNN'))+'.BKP')
Which in my case returns:
vFileName = BETAXIAD_20090216_1301.BKP               TEXT
Note the ability to use key items in different order. I like to put the year first when creating file names that way a directory listing (ordered) presents file name
in descending or ascending order by month and day with year.

Another example:
set var vdatefmt  text =(FORMAT(.#DATE,'DD-MMM-YYYY')) returns
vdatefmt           = 16-Feb-2009                              TEXT
or
set var vdatefmt  text =(FORMAT(.#DATE,'MMM+ dd, YYYY cc')) returns
vdatefmt           = February 16, 2009 AD                     TEXT
or
set var vdatefmt  text =(FORMAT(.#DATE,'Www+: MMM+ dd, YYYY '))
vdatefmt           = Monday: February 16, 2009                TEXT

For time:
set var vTime TEXT=(FORMAT(.#TIME,'HH:MM:SS.SSS')) returns
vTime              = 13:23:31.000                             TEXT
or
set var vTime TEXT=(FORMAT(.#TIME,'HH:MM:SS AP')) returns
vTime              = 1:25:11 PM                               TEXT
or even (although I can't imagine why)
set var vTime TEXT=(FORMAT(.#TIME,'AP MM/HH:SS')) returns
vTime              = PM 26/01:38                              TEXT

Imagine the possibilities!
No mucking with the SET TIME and SET DATE commands and their
consequent dangers in a multi-user environment.


Simply marvelous, James!

Very Best R:egards,

Razzak.


Reply via email to