February 15, 2005, 05:14 PM
bchinnapPrinting 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
LeahDisplaying year:
You might try a compute or define where TODAYS is your oracle date.
TODAYY/YY = TODAYS;
February 15, 2005, 05:30 PM
bchinnapI 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.grossHow is LOCL_TRAN_DATE declared in the MFD?
February 15, 2005, 05:41 PM
drew billingsleayou 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
bchinnapLOCL_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
LeahMy 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
LeahWhat 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 billingsleasince 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
bchinnapThat worked Drew !
Thanks
February 15, 2005, 10:34 PM
PiipsterI 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
webfocuspgmDrew,
Thanks your input helped me fix my problem too.