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     [CLOSED] Moving Date to Beginning of a year

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Moving Date to Beginning of a year
 Login/Join
 
Member
posted
I am trying to get two dates, (1) Today's date and (2) the start of the previous year (so 1/1/2018 as of today's date).

Here is what I have so far:

DEFINE FILE car
ED_DT/YYMD= '&DATEYYMD';
PV_YR/YYMD = DATEADD(ED_DT,'Y', -1)
ST_DT/YYMD = DATEMOV(PV_YR,'BOY')
END

The calls for ED_DT and PV_YR work as expected, and return 20191212 and 20181212 respectively. Its when I add the ST_DT line to move the 20181212 to 20180101 using DATEMOV, I get an error that says:

ERROR AT OR NEAR LINE 5 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC224) SYNTAX ERROR: ST_DT

ERROR AT OR NEAR LINE 12 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: PV_YR
(FOC009) Request failed validation, not executed.

I cannot figure its anything other than I can't do DATEMOV in a DEFINE FILE. Is that correct?

This message has been edited. Last edited by: FP Mod Chuck,


John Coleman
WEBFocus 8.1.05
Windows 7
 
Posts: 20 | Location: Rensselaer, NY | Registered: May 20, 2016Report This Post
Platinum Member
posted Hide Post
John

You were missing the " ; "

 

PV_YR/YYMD = DATEADD(ED_DT,'Y', -1);
ST_DT/YYMD = DATEMOV(PV_YR,'BOY');

 
 
Posts: 109 | Registered: February 02, 2016Report This Post
Member
posted Hide Post
I promise I have been doing this for more than a day, I swear! Thanks


John Coleman
WEBFocus 8.1.05
Windows 7
 
Posts: 20 | Location: Rensselaer, NY | Registered: May 20, 2016Report This Post
Platinum Member
posted Hide Post
That's how you learn anything.
Thank you.
 
Posts: 109 | Registered: February 02, 2016Report This Post
Virtuoso
posted Hide Post
I've bookmarked this page. It's where I go to find the syntax for any of these functions.

https://webfocusinfocenter.inf...urce/func_opener.htm


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Guru
posted Hide Post
also keep in mind that there are some new date time functions that will be better optimized to SQL, resulting in better performance.

 
DEFINE FILE car
ED_DT/YYMD= DT_CURRENT_DATE();
PV_YR/YYMD = DTADD(ED_DT, YEAR , -1);
ST_DT/YYMD = DTRUNC(PV_YR, YEAR);
END

 


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
 
Posts: 454 | Location: Europe | Registered: February 05, 2007Report 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     [CLOSED] Moving Date to Beginning of a year

Copyright © 1996-2020 Information Builders