Page 1 of 1

date format

Posted: Fri Jul 23, 2010 3:54 am
by angel1234
hi,
iam extracting the date from text file in the format 12/2/2010 00:00:00
i need it in the format 12-2-10. in the variables tab i put a new variable for my required format
and done like
new_datevariable=date(olddatevariable,'dd-mm-yy');

IS this a correct format??i am getting olddatevariable is undefined.Please help me as soon as possible

regards
Angel

Re: date format

Posted: Fri Jul 23, 2010 4:13 am
by Gregor Koch
Hi

To fix you error you need to set the 'Contents' (in the variables tab) of olddatevariable to 'Other'.
But this most likely will lead you to another error as the parameters for the DATE function are a Serial Number and a numeric flag. E.g. from reference guide: DATE(13947, 1)

Try using the SUBST function in combination with LONG.

Cheers