Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 1st August 2017, 11:29
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 133
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
Substract time period of actual date
Baan: Other/Unknown
C/S: None/Unknown

Hello to All,

I'd like to create a special print session where the user can choose a free time period (day, week, month, year) and a number for that periods.
For that the user can select events in past for a free selectable period.

Does there exist functions in Infor which will provide that or do I have to program it by my own?

Best Regards
Bernd
Reply With Quote
  #2  
Old 1st August 2017, 12:54
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,639
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
utc.add()

Hello,
Code:
utc.add()
Syntax:

function long utc.add  (long i.utc, long year, long month, long day, long hour, long minute, long second, long o.utc)

Description


This adds years, months, days, hours, minutes, seconds to the input utc value and makes corrections if necessary.

It processes the parameters from bigger to smaller units:

First adds only years and the date is corrected (if started from a leap year)
Than the months are added and the date is corrected to an existing one.
The addition of days follow, and the result is so far the same hour, minutes, as it was in the beginning in the actual time-zone.
Finally the hours, minutes, seconds are added.

Arguments

long i.utc  
long year  
long month  
long day  
long hour  
long minute  
long second  
long o.utc  
 
Return values

0 Success. 
1 Best guess. 
2 Failure. 
 
Context

This function can be used in all script types.

Example

This example shows the addition of days and hours across winter/summertime change

    in_utc = date.to.utc(2002,3,29,13,30,0)

    res = utc.add( in_utc, 0, 0, 1, 24, 0, 0, ou_utc )
The result in timezone "Europe/Amsterdam" is: ou_utc=1017577800, res = 0 (that is 2002.3.31 14:30:00)

This example shows the addition of days across winter/summertime change

    in_utc = date.to.utc(2002,3,29,13,30,0)

    res = utc.add( in_utc, 0, 0, 2, 0, 0, 0, ou_utc )
The result in timezone "Europe/Amsterdam" is: ou_utc=1017574200, res = 0 (that is 2002.3.31 13:30:00)

This example shows the substraction of 1 month from March 31st, 2000.

        in_utc = date.to.utc(2000,3,31,9,0,0)

        res = utc.add( in_utc, 0, -1, 0, 0, 0, 0, ou_utc )
The result in timezone "Europe/Amsterdam" is: ou_utc=951811200, res = 1 (that is 2000.2.29 9:0:0)
Regards
__________________
//Bernd
Reply With Quote
  #3  
Old 1st August 2017, 13:28
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,903
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
If it is like a couple of sessions I have done then I think you need to code it yourself. My session you only get weeks and months. So I have a simple drop yes/no drop down for printing by months(I think). Anyway if you enter yes - then the label for the next input range is year/month. If no I change the label to year/week. I think it defaults to like a year range - so the default for this month would be 2017/8 to 2018/8. If they pick no it changes to something like 2017/31 to 2018/30. Something like that.

I am thinking you could do a new domain with year, month, week, day - then do the same type deal with asking for input range. Of course this is assuming I understood the request to start with.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Sponsored Links
  #4  
Old 1st August 2017, 14:20
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 133
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
Hello Mark, Hello Bernd,

thanks a lot for fast reply.

The function utc.add() Bernd Dittmar has given works very fine. Simple and easy to integrate. Also well described :-).
Thanks a lot for that!

Best Regards
Bernd

Last edited by BaBernd : 1st August 2017 at 14:22. Reason: Spelling correction
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Time Conversion... suhas-mahajan Tools Development 6 8th October 2004 06:41
Time phased inventory movement date noonie Manufacturing & Supply Chain 0 20th February 2002 22:51


All times are GMT +2. The time now is 20:21.


©2001-2017 - Baanboard.com - Baanforums.com