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     Date arithmetic in dialog manager

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Date arithmetic in dialog manager
 Login/Join
 
Member
posted
Hello

I was wondering if anyone has done date calculations using DIALOG MANAGER.

I want to find the date from 1 month before today.

-SET &MTHDT = DATEADD(&TDAY1, 'M', -1)

But DATEADD function does not work with DIALOG MANAGER.
In past I had used AYMD function to find a date from searched date, but cant use in this scenario since I do not know if the month has 30 days or 31 days or 28 days.

Does anyone has any idea how to find the date before 1 month from searched date using using Dialog manager? Any help will be appreciated.


Thanks

ya
 
Posts: 19 | Location: Allstate Insurance Co. | Registered: January 25, 2005Report This Post
<Tim Howard_ABCBS>
posted
I know there have been a few posts on this in the past, you might want to search to find more information. You can use the following syntax to do what you're trying to do:

-SET &DATETMP = DATECVT((DATEADD((DATECVT(&DATEIN, 'I8YYMD', 'YYMD')),'M', -6)),'YYMD','I8YYMD');

I think I got this syntax from one of the old posts myself.
 
Report This Post
Expert
posted Hide Post
Yogi, you can use the AYMD function to add or subtract days from dialog manager date variables.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Susan
I cant use AYMD because I dont know if month has 30 days or 31 days. And then we also have a month with 28 days which mess up everything. Smiler

I will play with TIm's solution. THis might work.

Thanks
 
Posts: 19 | Location: Allstate Insurance Co. | Registered: January 25, 2005Report This Post
Expert
posted Hide Post
Yogi,

Tim's solution will work for you in DM for the simple reason that the inner most DATACVT is ensuring that the date you are using is converted into a non-legacy date format. This is what DATEADD requires, not the usual legacy date, and is usually where things go wrong for folks. The outer DATECVT ensures that the DATEADD output (which exists as a count of days since base date - 31/12/1900) is formatted as a legacy date once more.

It is always best to look at the help files when using date functions and pay particular attention to the type of format that a function requires.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
<Special-K>
posted
Yogi

You DO know how many days the previous month has.

If you subtract the number of days into this month from today, e.g. today is 20060419 take off 19 days that will give you the last date of the previous month!

-SET &TDAY = &YYMD;

-SET &DAYS1=EDIT(&TDAY,'$$$$$$99');
-SET &DAYS2=&DAYS1 * -1;
-SET &DATE1=AYMD(&TDAY,&DAYS2.EVAL,'I8YYMD');

-TYPE &TDAY &DAYS1 &DAYS2 &DATE1

&DATE1 will be the last day of the previous month
 
Report This Post
Member
posted Hide Post
Tim's solutions worked. You ROCK !!!

Thanks everyone.
 
Posts: 19 | Location: Allstate Insurance Co. | Registered: January 25, 2005Report 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     Date arithmetic in dialog manager

Copyright © 1996-2020 Information Builders