cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to compute "5 weeks before..." or such things

KaelLizak
14-Alexandrite

How to compute "5 weeks before..." or such things

How to compute "5 weeks before..." or such things (migrated thread) Posted: Jan 30, 2012 9:37 AM

   extern.jens-uwe.nixdorf     Posts: 68   Registered: Jan, 2010



Hi @all,

looks like i'm flooding this forum in the last days...
Here comes my latest question: In a form we have three date-fields. We want to fill one field by hand ("delivery date") and then we want to have the other two fields filled automatically with dates like five weeks before delivery date and so on. How can i do that without using trigger?

thanks, Jens
Re: How to compute "5 weeks before..." or such things Posted: Jan 31, 2012 5:24 AM
Posted By:   cstoss     Posts: 46 /  From: United Kingdon /  Registered: Jun, 2005  
Jens,

If you truly want "5 weeks before", that can be translated as "5 7 day periods before", which would be the computation:

"dateField - 35"

Since date subtraction is done by days.

From the Inetgrity Admin Guide. Section Timestamp Operations:

- timestamps can be subtracted or added to a constant integer, for example, now()+5 or now() - 5

Integer constants are treated in units of days; for example, timestamp + integer constant
takes the specified time and adds a specified number of days. When subtracting two
timestamps, the number of days between the two dates rounded to the nearest day is the
result. Using other operators or a floating point results in an error.


Regards,

Craig Stoss

          

Re: How to compute "5 weeks before..." or such things Posted: Jan 31, 2012 8:21 AM

Posted By:   extern.jens-uwe.nixdorf     Posts: 68 /  Registered: Jan, 2010  
Thanks, i'll try this. Unfortunately this section isnt available in the integrated help from the admin-client, and i didnt look into the admin guide...

regards, Jens

            

Re: How to compute "5 weeks before..." or such things Posted: Jan 31, 2012 8:31 AM

Posted By:   extern.jens-uwe.nixdorf     Posts: 68 /  Registered: Jan, 2010  
Hmmpf. Also wrong. It IS available in the online-help...
Sorry...

regards, Jens

Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
0 REPLIES 0
Announcements