Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
33%
Installation Wizard into new VRC
39%
Manual into existing VRC
6%
Manual into new VRC
22%
Total votes: 49

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 19th July 2018, 14:29
sakthi kj sakthi kj is offline
Junior Member
 
Join Date: May 2018
Posts: 7
sakthi kj is on a distinguished road
Baan: 9.2 - DB: sql - OS: windows10
Subtract Date and Year

hello,,mark_h….
how to subtract the current month and year to previous month and year ???
pls,,, I need to example script......quickly reply...plssss,,,,,
Reply With Quote
  #2  
Old 20th July 2018, 15:12
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,093
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
First moved to a new thread. Not sure I get the question and what your expected output should be. On the sessions where I ask for a month and year - I always assume the 1st of the month. So then I just create a date start.date = date.to.num(year.f,month.f,1). If you want to know the number of months between the two dates - you could create a formula or something. So it is hard to post an example without know what you really need. Plus you can always search this form for date example. I am sure there are quite a few.
__________________
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
  #3  
Old 21st July 2018, 20:56
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,713
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,
you can use:
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.
Code:
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
Sponsored Links
  #4  
Old 23rd July 2018, 06:07
sakthi kj sakthi kj is offline
Junior Member
 
Join Date: May 2018
Posts: 7
sakthi kj is on a distinguished road
Baan: 9.2 - DB: sql - OS: windows10
subtract date and year

Thanks for your idea...…………..
Reply With Quote
  #5  
Old 25th July 2018, 07:30
sakthi kj sakthi kj is offline
Junior Member
 
Join Date: May 2018
Posts: 7
sakthi kj is on a distinguished road
Baan: 9.2 - DB: sql - OS: windows10
how to check the seconds in utc.num()..????? :-(
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
Kalenderwoche MS-Tech Deutsches Forum 3 23rd February 2017 18:24
to get year from date priyanka pawar Tools Administration & Installation 1 10th June 2012 13:13
Time Conversion... suhas-mahajan Tools Development 6 8th October 2004 06:41


All times are GMT +2. The time now is 00:15.


©2001-2018 - Baanboard.com - Baanforums.com