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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Understanding Dates

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Understanding Dates
 Login/Join
 
Member
posted
Good afternoon guys,

I am looking for help with dates. Today is 1/2/2018. Last was 12/26/2017. I need to create two date variable to pass to a stored procedure (via synonym).

One assumes that I should be able to do:

SET &YEST = DATEADD('&DATEMDYY', 'D', -7);
SET &CURDATE = '&DATEMDYY';


It is a direct example taken from the book. It cannot be used to actually display a date and therefore the example is useless here.

My clients need normal 2-digit months, days and 4-digit years. My goal is to learn how to create these variable, manipulate them and display them on the reports under the healing.
.

What has to be done to get this working correctly.

Thanks,

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 19, 2017Report This Post
Expert
posted Hide Post
VH,
You need to make your dates "smart" dates prior to doing math...

Here's a way:

-SET &DATE_MINUS_7 = EDIT(DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-7), 'YYMD', 'I8YYMD'),'9999/99/99');
-TYPE &DATE_MINUS_7
-EXIT

OR MDYY format:

-SET &DATE_MINUS_7 = EDIT(DATECVT(DATEADD(DATECVT(&MDYY,'I8MDYY','MDYY'),'D',-7), 'MDYY', 'I8MDYY'),'99/99/9999');
-TYPE &DATE_MINUS_7
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
Tom,

That worked. Thanks! Do you know of a resources where the date functions are properly spelled out. I find the Tech Docs to be largely inadequate. Is there a good forum post you know of that has good instructions for date functions?


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 19, 2017Report This Post
Expert
posted Hide Post
VH,
Glad it helped.
You need to update your signature to the correct release, WebFOCUS 8 is not helpful.

Experience will be the best teacher, the BEST documentation is a book by John Price which discusses EVERYTHING about dates which you may want to buy a copy of:

"(almost) 1001 Ways to Work with DATES in WebFOCUS"

Also, Search on DATECVT, DATETRAN, HDATE, DATEADD, etc.

IBI does fine with most Function Reference's, go to the WebFOCUS 8 Technical docs, search on Function, Function Reference is there...
Links to all different kinds of Functions are listed...

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
quote:
"(almost) 1001 Ways to Work with DATES in WebFOCUS"

Such a good book, AKA: Very Useful!




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Master
posted Hide Post
quote:
...Is there a good forum post you know of that has good instructions for date functions?...


This thread was an attempt to create a source of date techniques/information.

The thread never received traction, and it might provide some assistance, for folks new to dates.
 
Posts: 822 | Registered: April 23, 2003Report This Post
Platinum Member
posted Hide Post


Dates in WF are probably the most frustrating aspect of the product. I can also vouch for the 1001 ways book, it is a bit expensive but worth it. I also find it most helpful to trial and error the functions you'll find available in the tool and if one seems logical but isn't working search the forum.

Sometimes it seems impossible to get what you really want, but 5 translations and conversions later you might have something.

Be sure if you're satisfied with the answers here to edit your initial post and add [Solved] to the beginning of the title.


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
 
Posts: 146 | Registered: November 09, 2015Report This Post
Member
posted Hide Post
Thanks you guys for all of your help with this topic. I think I am going to purchase the book for the company as I am not the only one here who could benefit from it.


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 19, 2017Report This Post
Expert
posted Hide Post
VH,
Send a note(Private Message if you like) to Vivian Perlmutter and see if there is an automated/on-line version you can place on a shared drive for everyone in your organization to access.
This would be best, I think...
Tom

Vivian


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
quote:
Originally posted by Tom Flynn:
VH,
Send a note(Private Message if you like) to Vivian Perlmutter and see if there is an automated/on-line version you can place on a shared drive for everyone in your organization to access.
This would be best, I think...
Tom

Vivian


I reached out to her last week per the info you provided. I am just waiting to hear back from her.


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 19, 2017Report This Post
Member
posted Hide Post
I reached out to her but she never responded to my message. Is she still active on the forum? it looks like here last post was in April.


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 19, 2017Report This Post
Expert
posted Hide Post
VH,
Try sending her an email at vivian@aviter.com.
Here's the LINK to the website...
Get a site license for updates...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
[QUOTE]Originally posted by Tom Flynn:
VH,
Try sending her an email at vivian@aviter.com.
Here's the LINK to the website...
Get a site license for updates...[/Q
UOTE]

Tom,

Thanks. I have sent her an email. I will see if we can purchase the site license from her.

VH


WebFOCUS 8
Windows, All Outputs
 
Posts: 19 | Registered: December 19, 2017Report This Post
Expert
posted Hide Post
Although
quote:
Dates in WF are probably the most frustrating aspect of the product.
They are also Very Powerful when understood.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 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     [SOLVED] Understanding Dates

Copyright © 1996-2020 Information Builders