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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change alpha field to date field 1

Status
Not open for further replies.

H1004

MIS
Oct 28, 2003
136
US
DEFINE FILE
COMP_DT/YYMD = EDIT(WRK_DTM);
ORG_SCH/YYMD = EDIT(ORG_WNT);
END

It doesn't like my field conversion!!! Am I using the right one?
 
Sorry I meant to write
DEFINE FILE tablename
COMP_DT/YYMD = EDIT(WRK_DTM);
ORG_SCH/YYMD = EDIT(ORG_WNT);
END
 
If WRK_DTM were defined as, for example, A8YYMD, then:

COMP_DT/YYMD = WRK_DTM;

should work.
 
WRK_DTM and ORG_WNT are A12 format, and I want these two fields to convert into DATE (YYMD)
 
The thing is that this field capture time as well..But I've already extracted the time out, so what left is only the date which is like 20031112
 
Cool, then you're almost there. Try:

WORK_DTM/A8YYMD=EDIT(WRK_DTM,'99999999$$$$');
COMP_DT/YYMD = WORK_DTM;

if the date is left justified in the 12 byte field. If not, adjust the position of the 9's.




 
That works!!! Why do we have to put the A8 in front of it???
 
Sorry, maybe that was too brief. You don't have a date field, you have an 8 byte alpha field. The YYMD just tells Focus how to format it if it prints it. Fortunately, it also tells Focus how to decode it if you want to set up a real date field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top