IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    AYMD Function
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Silver Member
Posted
Hi again

I have this problem with the AYMD function. (and possibly a problem with understanding data types in FOCUS).

I need a computed field, which is a calculation of a DATE field, added with the value of 2 other fields in the same row.

Here's what I have:

DEFINE FILE BSEG_ACC

-* Change date format to yymmdd format:
-* CHGDAT('oldformat','newformat',indate,outfield)
-*
TMPDATE1/A17 = CHGDAT('DMY','YMD',EDIT(BSEG_ZFBDT),TMPDATE1);

TMPDATE/I6YMD = EDIT(TMPDATE1);

NUMDAYS/I2 = BSEG_ZBD1T + BSEG_ZBD2T;

-* Add or subtract days to a date in yymmdd format:
-* AYMD(inDate, #days, outfield)
-*

DUEDATE/I6 = AYMD(TMPDATE, NUMDAYS, DUEDATE);

END[/code]I'm getting a table output, but the DUEDATE column is blank.
Any ideas as to why I'm not getting a date?

It seems I'm just missing some kind of conversion function or something.

This message has been edited. Last edited by: <Mabel>,
 
Posts: 44 | Location: Belgium | Registered: January 10, 2005Reply With QuoteEdit or Delete MessageReport This Post
<WFUser>
Posted
Adding a number of days to date field is really less complicated than you think. You do not need the date subroutines. Try this.

DEFINE FILE CAR
TODAY/MDYY = &MDYY;
NUMDAYS/I2 = 7;
NEXTWEEK/MDYY = TODAY + NUMDAYS;
END
TABLE FILE CAR
PRINT CAR MODEL SEATS NEXTWEEK
BY COUNTRY
END
 
Reply With QuoteEdit or Delete MessageReport This Post
Silver Member
Posted Hide Post
Indeed.

I just figured it out myself as well :/

Thanks for replying!
 
Posts: 44 | Location: Belgium | Registered: January 10, 2005Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
Tim, it appears that TMPDATE and DUEDATE are not of the same format. one is i6ymd and the other i6 only.. might be why its blank.
 
Posts: 2627 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
Silver Member
Posted Hide Post
quote:
Originally posted by susannah:
[qb] Tim, it appears that TMPDATE and DUEDATE are not of the same format. one is i6ymd and the other i6 only.. might be why its blank. [/qb]
TMPDATE was already blank, because the EDIT(BSEG_ZFBDT) was returning a number, it looked like the amount of days since some date.

But it doesn't matter, problem solved. Smiler
Thanks for replying though.
 
Posts: 44 | Location: Belgium | Registered: January 10, 2005Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
quote:
Originally posted by Tim Schraepen:
[qb] ...
DEFINE FILE BSEG_ACC
TMPDATE1/A17 = CHGDAT('DMY','YMD',EDIT(BSEG_ZFBDT),TMPDATE1);
TMPDATE/I6YMD = EDIT(TMPDATE1);
NUMDAYS/I2 = BSEG_ZBD1T + BSEG_ZBD2T;
DUEDATE/I6 = AYMD(TMPDATE, NUMDAYS, DUEDATE);
END
...
DUEDATE column is blank.
[/qb]
DUEDATE/I6 can be zero, but how can it display as "blank"?

Print all contributing fields to see where in the chain unexpected results appear:

BSEG_ZFBDT (format?)
BSEG_ZBD1T
BSEG_ZBD2T
TMPDATE1
TMPDATE
NUMDAYS
DUEDATE
 
Posts: 532 | Location: NYC | Registered: January 11, 2005Reply 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    AYMD Function

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