Ola Bruce:

I've been using the TO DELIM extract method almost exclusively. You can 
pretty much wrap any unibasic command in an EVAL"..." statement (including 
the all-powerful file translate OCONV(MyField,TFilename;X;;FieldNum) ). 
Dates are formatted with EVAL"OCONV(MyField,'D4/')". Note that any UniBasic 
syntax requiring quotes inside an EVAL need to be wrapped in single quotes 
else you short-circuit the EVAL.

Multivalue fields containing multiple dates are still a problem though.

If useful, You can pick the first value in multivalue date by using the 
'FIELD' command:

EVAL"OCONV(FIELD(OCONV(MyField,TFilename;X;;FieldNum),@VM,1,1),'D4/')"  *
Look up a multivalue date in another file, select the first one, and format 
it as "m/d/yyyy"
or the last with

EVAL"OCONV(FIELD(OCONV(MyField,TFilename;X;;FieldNum),@VM,DCOUNT(MyField,@VM),1),'D4/')"
Look up a multivalue date in another file, select the last one, and format 
it as "m/d/yyyy"

However, if you are working in Microsoft on the desktop (Excel, Access VBA, 
VB) you can add the constant 24837 to any unidata internal format date and 
convert it to a VB DateTime field.

Sample query using EVAL and date formatting:

LIST STUDENT.NON.COURSES EVAL"OCONV(STNC.PERSON.ID,'TPERSON;X;;1'):', 
':OCONV(STNC.PERSON.ID,'TPERSON;X;;3')" STNC.PERSON.ID 
EVAL"OCONV(OCONV(STNC.PERSON.ID,'TPERSON;X;;14'),'D4/')" STNC.CATEGORY 
STNC.TITLE STNC.NON.COURSE EVAL"OCONV(STNC.START.DATE,'D4/')" STNC.SCORE 
STNC.PCT ID.SUP NOPAGE TO DELIM "|" _HOLD_/_PSC_ST_NonCourses.txt

In this case in our enviroment the 
EVAL"OCONV(OCONV(STNC.PERSON.ID,'TPERSON;X;;14'),'D4/')" looks up the 
birthdate using the Person key and formats it as a date.

Note the NOPAGE command which suppresses the need for user intervention for 
the query to complete.

R x3785

====================
Rich Harrington
Prairie State College MIS
(708) 709-3785
====================
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to