Focal Point
[SOLVED] Understanding Dates

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7647068886

January 02, 2018, 01:09 PM
Very Helpful
[SOLVED] Understanding Dates
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
January 02, 2018, 02:05 PM
Tom Flynn
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
January 02, 2018, 02:31 PM
Very Helpful
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
January 02, 2018, 02:50 PM
Tom Flynn
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
January 02, 2018, 05:57 PM
Doug
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
January 03, 2018, 09:44 AM
David Briars
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.
January 03, 2018, 11:25 AM
jcannavo


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
January 03, 2018, 11:40 AM
Very Helpful
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
January 03, 2018, 12:32 PM
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


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
January 08, 2018, 10:18 AM
Very Helpful
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
January 31, 2018, 10:51 AM
Very Helpful
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
January 31, 2018, 11:15 AM
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...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
January 31, 2018, 12:09 PM
Very Helpful
[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
February 01, 2018, 08:58 AM
Doug
Although
quote:
Dates in WF are probably the most frustrating aspect of the product.
They are also Very Powerful when understood.