Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Dates, date functions and where statements

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Dates, date functions and where statements
 Login/Join
 
Platinum Member
posted
My report needs the user to submit a date and then the report needs to give data based on the date submitted by the user as well as the same date last year. Getting data with the date submitted by the user isn't a problem, but I'm trying to use the DATEADD function to get the data for the same date last year and get the following error message:
(FOC280) COMPARISON BETWEEN COMPUTATIONAL AND ALPHA VALUES IS NOT ALLOWED

Here is the code I'm using (&CY_DATE is the user inputed date field in format MDYY):

PRINT
LINE_AMT
BY LINE_SA_ID_TYPE
BY LINE_COMMON_ID AS LY_EMPLID
BY ITEM_ACCOUNT_TERM
WHERE LINE_POSTED_DATE LE DATEADD(&CY_DATE, 'Y', -1);
ON TABLE PCHOLD FORMAT EXL2K
END

Any help is appreciated.


Server Environment: Win2K3 Server WebFOCUS 7.13 Apache Tomcat standalone application server
 
Posts: 188 | Registered: April 14, 2005Report This Post
Virtuoso
posted Hide Post
You need to convert the input date to a smart date that you can subtract from. The entered date is considered 'alpha' by the routine. This assumes of course line_posted_date is a smart date.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Platinum Member
posted Hide Post
How just subtracting a year using Dialog Manager:

-SET &INPDT='03062006';
-SET &INPDTMD=EDIT(&INPDT,'9999');
-SET &INPDTYY=EDIT(&INPDT,'$$$$9999');
-SET &INPDTYY2=&INPDTYY - 1;
-SET &LASTYR=&INPDTMD | &INPDTYY2;
-TYPE CURRENT YEAR &INPDT LAST YEAR &LASTYR

gives the following results:

CURRENT YEAR 03062006 LAST YEAR 03062005


FOCUS 7.6 MVS PDF,HTML,EXCEL
 
Posts: 115 | Location: Chicago, IL | Registered: May 28, 2004Report This Post
Guru
posted Hide Post
Try single quotes around the date value:

WHERE LINE_POSTED_DATE LE DATEADD('&CY_DATE', 'Y', -1);


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Dates, date functions and where statements

Copyright © 1996-2020 Information Builders