Baanboard.com

Go Back   Baanboard.com > Forum > BB Language Forums > Deutsches Forum

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

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 20th February 2017, 16:10
MS-Tech MS-Tech is offline
Member
 
Join Date: Dec 2015
Posts: 66
MS-Tech is on a distinguished road
Baan: 6 - DB: SQL-Server - OS: Windows 7
Kalenderwoche
Baan: Other/Unknown

Hallo Zusammen,

gibt es in LN eine Funktion, mit der ich mir die aktuelle Kalenderwoche eines Datums ermitteln kann? Ich möchte z.B. einen Report erstellen, bei dem ich dann von Woche / bis Woche filtern kann?

Grüße
MS-Tech
  #2  
Old 21st February 2017, 14:03
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 418
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hallo,

es gibt die Funktion utc_to_week() für normale (UTC) Daten. Für ein Datum in Baan4 oder Fibu-Format gibt es dagegen num_to_week().
__________________
May the force be with you!
  #3  
Old 21st February 2017, 15:38
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.to.week()/num.to.week()/sprintf$()

Hallo,
hier einige Hinweise:
Code:
utc.to.week()
Syntax:

function long utc.to.week  (long utc, ref long week_dayno, ref long year_dayno, ref long weekno, ref long hours, ref long minutes, ref long seconds [, ref long yearno])

Description


This converts a UTC long format value to the corresponding day of the week, day of the year, week of the year, and so on, in local time.


Arguments

long utc The UTC long format value.
 
ref long week_dayno The day of the week. This depends on which day is defined as the first day of the week in the user data settings in the data dictionary.
 
ref long year_dayno The day number in the year.
 
ref long weekno The week number in the year. See Week handling.
 
ref long hours The time of day.
 
ref long minutes  
ref long seconds  
[ref long yearno ] The year number. This argument is optional.
 
 
Return values

0 Success. 
-1 Error. 
 
Context

This function can be used in all script types.

Notes
If the day of the week lies in the week that includes the turn of the year, weekno returns either 53, 0, or 1. The rules applied are:

Yearno argument included 
If less that 4 days of the week belong to the old year, weekno returns 1 and yearno returns the number of the new year.
If 4 or more days belong to the old year, weekno returns 53 and yearno returns the number of the old year.
Yearno argument not included 
If the day belongs to the old year, weekno returns 53.
If the day belongs to the new year and there are less that 4 days of the new year in the week, weekno returns 0.
If the day belongs to the new year and there are more that 3 days of the new year in the week, weekno returns 1.
Related topics 

Dates, times, time zones synopsis
Dates,times, time zones overview
--------------------------------------------------------------------------------------------------------
num.to.week()
Syntax:

function long num.to.week  (long dayno, ref long week_dayno, ref long year_dayno, ref long weekno [, ref long yearno])

Description


This converts a specified number of days since 01-01-0001 to the corresponding day of the week, day of the year, and week number of the year.


Arguments

long dayno A number of days since 01-01-0001.
 
ref long week_dayno The day of the week. This depends on which day is defined as the first day of the week in the user data settings in the data dictionary.
 
ref long year_dayno The day number in the year.
 
ref long weekno The week number in the year. See Week handling.
 
[ref long yearno ] The year number. This argument is optional.
 
 
Return values

0 Success. 
-1 Error. 
 
Context

This function can be used in all script types.

Notes
If the day of the week lies in the week that includes the turn of the year, weekno returns either 53, 0, or 1.  The rules applied are:

Yearno argument included 
If less that 4 days of the week belong to the old year, weekno returns 1 and yearno returns the number of the new year.
If 4 or more days belong to the old year, weekno returns 53 and yearno returns the number of the old year.
Yearno argument not included 
If the day belongs to the old year, weekno returns 53.
If the day belongs to the new year and there are less that 4 days of the new year in the week, weekno returns 0.
If the day belongs to the new year and there are more that 3 days of the new year in the week, weekno returns 1.
Related topics 

Dates, times, time zones synopsis
Dates,times, time zones overview
----------------------------------------------------------------------------------------------------
Nur Darstellung :

sprintf$()

%D xxx [ ,lang ] Use for dates.

xxx is the code for a date format defined in the data dictionary. lang indicates the language code to use. If this is omitted, the current user language is used.

The expression that is substituted for this symbol must specify a number of days since 01-01-0001.

Note that it isn't possible to use a comma direct after a %D xxx substitution symbol other than for selecting a language. As a workaround select a space as the language code, this will substitute the users default language and close the type element. Now it is possible to use the comma that should be included in your string. See the example in the example section.
 
%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’) 
 
You can combine these subformats with other formats. Note that strings returned by name of month and day formats are language dependent.
 
%u xxx [ ,lang ] Use for UTC dates. xxx is the code for a UTC date format defined in the data dictionary. lang indicates the language code to use. If this is omitted, the current user language is used. 
Note that it isn't possible to use a comma direct after a %u xxx substitution symbol other than for selecting a language. As a workaround select a space as the language code, this will substitute the users default language and close the type element. Now it is possible to use the comma that should be included in your string. See the example in the example section.
 
%U xxx [ ,lang ] Use for UTC times. xxx is the code for a UTC time format defined in the data dictionary. lang indicates the language code to use. If this is omitted, the current user language is used. 
Note that it isn't possible to use a comma direct after a %U xxx substitution symbol other than for selecting a language. As a workaround select a space as the language code, this will substitute the users default language and close the type element. Now it is possible to use the comma that should be included in your string. See the example in the example section.
 
%u( format ) Use for UTC dates.

This option enables you to define your own date format by using the subformats described for the ‘ %D( format )’ symbol. You can combine these subformats with other formats.

Note that strings returned by name of month and day formats are language dependent.
 
%U( format ) Use for UTC times.

This option enables you to define your own time using the following subformats of the ‘%U’ format.

%H hours in 24 hour format 
%h hours in 12 hour format 
%m minutes 
%s seconds 
%a substitutes the am/pm symbol as defined for the user language 
%x time separator as specified for the user language
Gruss
__________________
//Bernd
  #4  
Old 23rd February 2017, 18:24
MS-Tech MS-Tech is offline
Member
 
Join Date: Dec 2015
Posts: 66
MS-Tech is on a distinguished road
Baan: 6 - DB: SQL-Server - OS: Windows 7
Danke für eure Hinweise. Ich werde das gleich mal testen .

Grüße
MS-Tech
Closed Thread


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


All times are GMT +2. The time now is 22:30.


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