Focal Point
Printing Year

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4041038331

February 15, 2005, 05:14 PM
bchinnap
Printing Year
Hi,
Can somebody tell me how to retrieve and display just the year from the date field. The data is coming from Oracle.

Thanks for the help
February 15, 2005, 05:23 PM
Leah
Displaying year:

You might try a compute or define where TODAYS is your oracle date.

TODAYY/YY = TODAYS;
February 15, 2005, 05:30 PM
bchinnap
I have tried that in a define
TransactionYear/YY = LOCL_TRAN_DATE; where LOCL_TRAN_DATE is the date field from oracle.
But I am getting this error:
(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: TransactionYear
Also I need the 4-digit year
February 15, 2005, 05:32 PM
j.gross
How is LOCL_TRAN_DATE declared in the MFD?
February 15, 2005, 05:41 PM
drew billingslea
you might try:

CDATE/YY = HDATE(CYCLE_D,'YY') ;

where CYCLE_D is the Oracle data column name, if you are getting the date from SQL passthrough or whatever.

hth,

drew
February 15, 2005, 05:45 PM
bchinnap
LOCL_TRAN_DATE is defined as HYYMDS.
I have already done one convertion to remove the time part with this command:
TransactionDate/MDYY= HDATE( LOCL_TRAN_DATE ,'MDYY' );
February 15, 2005, 05:46 PM
Leah
My experience is with DB2 fields and if I put in the

TransactionYear/YY = BIRTH_DT;

Against one of tables I get the year just fine when printed. So is it a 'smart date'?

This is under WebFOCUS 5.3.3
February 15, 2005, 05:48 PM
Leah
What happens if
I have already done one convertion to remove the time part with this command:
TransactionDate/MDYY= HDATE( LOCL_TRAN_DATE ,'MDYY' );

is changed to
I have already done one convertion to remove the time part with this command:
TransactionDate/MDYY= HDATE( LOCL_TRAN_DATE ,'YYMD' );
February 15, 2005, 05:52 PM
drew billingslea
since you already have a smart date field defined with the date you could:

TRAN_YEAR/YY = TransactionDate;

hth,

drew
February 15, 2005, 05:57 PM
bchinnap
That worked Drew !

Thanks
February 15, 2005, 10:34 PM
Piipster
I just spotted this on the Education Web Site ...

eLearning Seminar on the Date/Time datatype.

http://education.informationbuilders.com/jsp/edu/e_courseCatalog.jsp.
March 31, 2005, 01:13 PM
webfocuspgm
Drew,
Thanks your input helped me fix my problem too.