IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Date format to String format
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Gold member
Posted
I have a question to convert a date format (28/03/2004) to a string format (20040328). Is there any function or command to do this in WebFocus?
 
Posts: 55 | Registered: May 15, 2004Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
If the format of the field is "DMYY" then create a define such as this.
DEFINE FILE CAR
DATE1/A8DMYY = YOURDATEFIELD ;
DATE2/A8 = EDIT(DATE1,'$$$$9999') | EDIT(DATE1,'$$99') | EDIT(DATE1,'99') ;
END

Now you will have am Alphanumeric(text) field that is in YYYYMMDD order.
 
Posts: 8 | Location: Melville,NY | Registered: August 09, 2004Reply With QuoteEdit or Delete MessageReport This Post
Gold member
Posted Hide Post
Thank you very much. It works fine !
 
Posts: 55 | Registered: May 15, 2004Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
or, using the DATECVT function which
changes the form of your smart date...

temp/YYMD = DATECVT(yourdate,'DMYY','YYMD' );
temp1/A8DMYY = temp;
RESULTDATE/A8 = temp1;
produces...
MYDATE.....temp..........temp1........RESULTDATE
13/09/2004 2004/09/13 2004/09/13 20040913
 
Posts: 2631 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Date format to String format

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.