Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
17%
200 - 500 GB
17%
500 - 800 GB
6%
800 - 1200 GB
6%
1200 - 1500 GB
17%
1500 - 2000 GB
17%
> 2000 GB
22%
Total votes: 18

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 29th December 2007, 06:57
jpradips jpradips is offline
Member
 
Join Date: Apr 2006
Posts: 65
jpradips is on a distinguished road
Baan: BAAN IV SP 15 - DB: SQL SERVER 7 - OS: WIN 2000
Need some guide regarding variable converting..
Baan: Baan IVc
C/S: Both

Dear Friends,

I am writing report script, but I am not able to write some variable converting commands. Pl. guide me for below variable converting...

1. Variable date to string
2. Variable string to date
3. Search the day, month and year from date
4. Search week number (means I want to search the week number with starting and ending date) from specify date.

The above commands is very useful for my script.
Pl. guide as early as possible.

Thanking you,

Pradeep Joshi.
Reply With Quote
  #2  
Old 29th December 2007, 12:07
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,723
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
Use the programmer's guide !

Quote:
Originally Posted by jpradips View Post
Dear Friends,

I am writing report script, but I am not able to write some variable converting commands. Pl. guide me for below variable converting...

1. Variable date to string
2. Variable string to date
3. Search the day, month and year from date
4. Search week number (means I want to search the week number with starting and ending date) from specify date.

The above commands is very useful for my script.
Pl. guide as early as possible.

Thanking you,

Pradeep Joshi.
Hello,

please use the programmer's guide for BaaN.

For example :

date.to.inputstr$()

--------------------------------------------------------------------------------

Syntax
string date.to.inputstr$( long dayno, string format(7), long length )

Description
This converts a specified number of days since 01-01-0001 to a date input string.

Arguments
dayno
A number of days since 01-01-0001.

format
The format for the date string, specified by using the substitution symbols
%Dxxx[, lang] or %D(format). See sprintf.

length
The length of the date string:

6: year represented by 2 characters (century not included)
8: year represented by 4 characters (century included).


Return values
The formatted input string.

An empty string if an error occurs.


Context
Bshell function.

Example
This example creates a default input string for the data.input function.

string inpstring(8)
inpstring = date.to.inputstr$( 727000, "%D002,3", 8 )
If the %D002 format for language 3 is MDY, the string returned is "06171991" (that is, June 17, 1991). If it is DWY, and the first day of the week is Sunday, the string returned is "2251991" (that is, day 2, week 25, 1991).

For your requirements use "num.to.week" or another built in converting function :

num.to.week()

--------------------------------------------------------------------------------

Syntax
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
dayno
A number of days since 01-01-0001.

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.

year_dayno
The day number in the year.

weekno
The week number in the year. See Week handling.

yearno
The year number. This argument is optional.


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.
Return values
0 Success.

-1 Error

Or use a predifined date format as reportfield.


Regards
__________________
//Bernd

Last edited by bdittmar : 29th December 2007 at 12:31. Reason: Add
Reply With Quote
Sponsored Links
  #3  
Old 31st December 2007, 08:38
jpradips jpradips is offline
Member
 
Join Date: Apr 2006
Posts: 65
jpradips is on a distinguished road
Baan: BAAN IV SP 15 - DB: SQL SERVER 7 - OS: WIN 2000
Dear Sir,

I am going to write the script through your guidance.

Thanks and Regards,
Pradeep Joshi
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
Variable value different in pgm. script & report script ? PacSun Tools Development 5 28th June 2006 19:09
SSA ERP-NL / Baan V6 is it Vaporware ? tjbyfield General Discussion & Chat 18 1st October 2004 10:50
NEW: BaanERP Programmer's Guide on-line! patvdv About Baanboard.com 30 24th January 2004 10:27
How to get variable from Unix to Baan nelson ostos Tools Development 5 10th October 2003 16:02
Old but good stuff montanac Baan vs SAP, Peoplesoft, JDE, Oracle etc 0 15th April 2002 16:20


All times are GMT +2. The time now is 17:55.


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