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
36%
Installation Wizard into new VRC
36%
Manual into existing VRC
7%
Manual into new VRC
22%
Total votes: 45

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 3rd April 2018, 12:18
Svidos29 Svidos29 is offline
Member
 
Join Date: Oct 2017
Posts: 35
Svidos29 is on a distinguished road
Baan: Baan IV - DB: Onpen Sql - OS: Windows 10
Calculate weeks based on the day
Baan: ERP LN 6.1 FP11 (Infor ERP 10.5)
C/S: Client

Hi all,

the question is: how can i calculate the number of the week, based on the day that i have ? For example 05/02/2018 ==> week 6.

thanks in advance.
Reply With Quote
  #2  
Old 3rd April 2018, 13:36
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,069
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I do not know about LN but in 4c4 I can look at the company calendar (tirou400) to get the week.
__________________
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 3rd April 2018, 13:58
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,708
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
sprintf$()

Hello,
do a search before post, please. It's discussed several time.

Use sprintf$()
Code:
%D( format ) Use for dates.

This option enables you to define your own date format by using the following subformats of the ‘%D’ format:

%m month in year 1 - 12 
%w week in year week 0 in previous year week 53 in current year 
%W week in year week 53 in previous year 
%d day in month 1 - 31 
%e day in week 1 - 7 
%j day in year 1 - 365 
%y year without century 01 - 99 
%Y year with century 1 - 9999 
%h name of month (‘Jan’ - ‘Dec’)

(abbreviated)
 
%H name of month (‘January’ - ‘December’) 
%a name of day (‘Sun’ - ‘Sat’)

(abbreviated)
 
%A name of day (‘Sunday’ - ‘Saturday’)
Example:
Code:
Dates

| Suppose date format 002 is: "year/month/day in month"

string result(80)

result = sprintf$("%D002", 727168)

    | result contains "1991/12/2"

| Example of substitution symbol %D(format)

string result(80)

result = sprintf$("%D(Date: %02d/%02m/%04Y)", date.num())

    | result contains "Date: 12/07/1993"

result = sprintf$("Date: %D(%02d %-20H %04Y)", date.num())

    | result contains "Date: 12 June                 1993"

UTC dates and times

| Date format 002 is "year/month/day in month"

| Time format 001 is "12 hour format:minutes:seconds AM/PM symbol"

string result(80)

result = sprintf$(" %001", utc.num(), utc.num())

    | Result contains "1997/01/01 10:02:53 pm"

string result(80)

result = sprintf$("UTC: %u(%02d/%02m/%04Y) %U(%02h%x%02m%x%025 %a)", utc.num(), utc.num())

    | result contains "UTC: 22/07/1997 06:24:53 am"

    | provided that for the user's language the time

    | separator is ":" and the AM symbol is "am"

| Using a comma after a %u substitution symbol

string result(80)

result = sprintf$(", ,Message text....", utc.now())

    | result containts "06-05-15,Message text...."
Regards
__________________
//Bernd
Reply With Quote
  #4  
Old 3rd April 2018, 15:46
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 435
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi Svidos29,

you depending on your type of date (UTC or days since 01.01.01) you can use either num.to.week() or utc.to.week() function!
__________________
May the force be with you!
Reply With Quote
  #5  
Old 11th April 2018, 00:23
v_kewl v_kewl is offline
Member
 
Join Date: Dec 2008
Posts: 58
v_kewl is on a distinguished road
Baan: LN 6.1 - DB: MS SQL - OS: Windows 2003
long o.wkdy, o.yrdy, o.week, o.year

num.to.week(date.num(), o.wkdy, o.yrdy, o.week, o.year)

o.week hold the value which you are looking
Reply With Quote
Sponsored Links
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
Invoices printing issue-display last record with 2 lines tracylee Tools Development 7 20th October 2017 10:51
Kalenderwoche MS-Tech Deutsches Forum 3 23rd February 2017 18:24
Provide day to day Baan IVc4 application support. Be the subject matter expert for Ba danburkart28 Jobs and Resumes 1 14th December 2013 04:06
report print condition Elrodyn Tools Development 3 18th March 2009 10:13
MRP Bucketing - Demand on last day of period Bryan Manufacturing & Supply Chain 4 14th December 2001 18:51


All times are GMT +2. The time now is 23:41.


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