Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Adding number of days to a virtual date field
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Adding number of days to a virtual date field
 Login/Join
 
Member
posted
My task is to calculate an expiration date and populate on a report as a field. The expiration date is a calculation that adds the shelf-life number of days (field in a table xld_1) to another date (virtual field exdt_2) to arrive at a date where the material is expected to expire. I believe I need to create a define by adding the shelf life days (DATEADD??) to the other date but not sure how to achieve this and any help or example would be greatly appreciated.

Solution Solved: ExpDate/YYMD= DATEADD(ExpYYMD, 'D', IR_SLD_I);

This message has been edited. Last edited by: Kort Thompson,


KW

WF Versions: DEV 8105 OS: Windows Outputs: HTML, Excel
In WebFOCUS since March '19
 
Posts: 7 | Registered: March 18, 2019Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Have a look at the fallowing : DTADD: Incrementing a Date or Date-Time Component

Also, please update you signature to add your WF version. That may help to point you to the proper solution according to your version

And why [Advise??] in your subject ? Try to stay with forum's structure : Forum Guidelines


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2159 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Member
posted Hide Post
Thank you Martin for the guidance.


KW

WF Versions: DEV 8105 OS: Windows Outputs: HTML, Excel
In WebFOCUS since March '19
 
Posts: 7 | Registered: March 18, 2019Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Hi Kort,

Here a simple sample where I extract a NBDAYS value to increment from based on another file
TABLE FILE CAR
BY SEATS AS 'NBDAYS'
WHERE COUNTRY EQ 'JAPAN';
ON TABLE HOLD AS INCRDAYS
END
-RUN
-READFILE INCRDAYS
-DEFAULTH &NBDAYS = 0
-TYPE NBDAYS: &NBDAYS

DEFINE FILE WF_RETAIL
NEWDATE/YYMD = DTADD(DATE_OF_BIRTH, DAY, &NBDAYS);
END
TABLE FILE WF_RETAIL
SUM DATE_OF_BIRTH
    NEWDATE
BY ID_MANAGER
ON TABLE SET PAGE NOPAGE
END
-RUN

Look at manager id 901 where the DTADD function manage the fact the +4 days has also changed the month


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2159 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Member
posted Hide Post
Thanks for the help Martin! Really appreciate you


KW

WF Versions: DEV 8105 OS: Windows Outputs: HTML, Excel
In WebFOCUS since March '19
 
Posts: 7 | Registered: March 18, 2019Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Wink My pleasure

If solved, please edit your first post then add [SOLVED] at the beginning of the subject instead of [SHARING] which is not the case for that post.
You were not sharing with us a solution that you found, but was asking for a solution.


WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2159 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Adding number of days to a virtual date field

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.