80279-howtousedatebsfn
TRANSCRIPT
Title: How to use Date Business Functions in the J.D. Edwards softwareAbstract: This document provides information on various date business functions that are available in the J.D. Edwards software.
Product J.D. Edwards 5 and OneWorld® Software
Suite Technical
Release ERP 8.0, Xe
Document ID ott-01-0053
Date Created 05/04/2001
Date Reviewed 01/30/2003
Date Revised 01/30/2003
Table of Contents
1. Summary Table of the Date Business Functions
2. What is JDE Julian Date?
3. JDE Date Routines: Date Mask Available
4. B0000127: ReturnTodaysDate
5. B0700068: RetrieveDayofWeek
6. B4201480: GetDayofWeek
7. B0800013: ConvertStringToDate
8. B0800208: ConvertStringDatetoDateFormat
9. B3000250: GetMonthDescription
10. B3000260: GetYearDescription
11 B41B0470: FormatDateFromDMY
12. B7600920: ConvertNumbersAndDatesToString
13 . B9100001: ConvertjulianDatetojdeDate
14. B9800210: Convert From and To Julian Date from JDEDATE
15. B4500490: DateConversiontoJulian
16. B0000200: SixDigitNumerictoDate
17. B0000200: DatetoSixDigitNumeric
18. B9800460: ConvertDateToString
19. N1700090: CalculateBeginDateofPeriod
Summary Table of the Date Business Functions
Source Module
Function Name Input Output
B0000127 ReturnTodaysDate None JDE Date B0700068, B4201480
RetrieveDayofWeek, GetDayofWeek
JDE Date Day description, i.e. Monday, Tuesday, ….
B0800013 ConvertStringToDate String MM/DD/YYYY
JDE Date
B0800208 ConvertStringDatetoDateFormat String Date + Date Mask
JDE Date
B3000250 GetMonthDescription Numeric Calendar Month
Month description, i.e. January, February, ....
B3000260 GetYearDescription Numeric Calendar Year
4-digit year description
B41B0470 FormatDateFromDMY String YY, MM, DD JDE Date B7600920 ConvertNumbersAndDatesToStrin
g JDE Date String
B9100001 ConvertjulianDatetojdeDate Numeric CYYDDD JDE Date B9800210 ConvertDateToJulian JDE Date Numeric
YYYYDDD B9800210 ConvertJulianToDate Numeric
YYYYDDD JDE Date
B4500490 DateConversiontoJulian JDE Date Numeric CYYDDD B0000200 SixDigitNumerictoDate Numeric CYYDDD JDE Date B0000200 DatetoSixDigitNumeric JDE Date Numeric CYYDDD B9800460 ConvertDateToString JDE Date + Mask String N1700090 CalculateBeginDateofPeriod Period Number,
Company, Fiscal Year and Century
Period Begin Date, Period End Date, Begin Date of Fiscal Year, and/or Period Ending Dates for all 14 Periods
Back to Top
What is JDE Julian Date?
All dates in the J.D. Edwards database are stored in a JDE Julian format. A date in JDE Julian format is a six-digit numeric field which represents the century, year and day of the year. It should be updated using the following rules:
The first digit describes the century. A value of 0 indicates the 20th century (1900s). A value of 1 indicates the 21st century (2000s);
The second and third digits represent the year (98, 99, 00, 01, etc); The fourth, fifth and sixth digits represent the day in the year (001 for January 1,
112 for April 21, etc.)
Example:
The date for January 31, 2000 = 100031 in a Julian date format (CYYDDD).
1 = 21st Century
00 = Year in the 21st Century
031 = Day in the year
Note: If the Business Function requires JDEDATE as an input/output parameter, users can only pass parameters with the attribute of data dictionary item type 11 (Date) and class DATEW. The Business function will not return correct information if the user passes a numeric field of CYYDDD to the JDEDate parameter.
Back to Top Back to Summary Table
JDE Date Routines: Date Masks Available
MASK DESCRIPTION D Day Number, 1 or 2 digits A Day Number, zero pad to 2 digits Y Day Number, space pad 2 digits M Month Number, 1 or 2 digits O Month Number, zero pad to 2 digits N Month Number, space pad to 2 digits T Month Number, by language, from UDC B Abbreviated Month Name, by language, from UDC R 2 digit year E 4 digit year S Date slash character, from configuration C Date comma character, from configuration
Back to Top Back to Summary Table
B0000127: ReturnTodaysDate
Purpose:
This function will return today's date in a Julian date (JDE format).
Parameters:
Data Structure: D0000127
Parameter Name Data Item Data Type I/O jddateDateForToday DGJ JDEDATE O
Back to Top Back to Summary Table
B0700068: RetrieveDayofWeek
Purpose:
This function will take a date, and return the numeric day of the week (0-6) and its' corresponding description (Sunday-Saturday).
Numeric Value Descriptions 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday
Parameters:
Data Structure: D0700068C
Parameter Name Data Item Data Type I/O jdDate BDOWLD JDEDATE I mnDayofWeek DOW MATH_NUMERIC O dsDayofWeekDesc DS20 Char O
Back to Top Back to Summary Table
B4201480: GetDayofWeek
Purpose:
This function will take a date, and return the numeric day of the week (0=Sunday, 6=Saturday) and error code (0=success).
Parameters:
Data Structure: D4201480A
Parameter Name Data Item Data Type I/O jdDate DTE JDEDATE I mnDayofWeekA DOW MATH_NUMERIC O cErrorCode ERRC Char O
Back to Top Back to Summary Table
B0800013: ConvertStringToDate
Purpose:
This function will convert a string that is in a date format (MM/DD/YYYY) to a Julian date (JDE format). One digit day and/or one digit month input won't work on this business function.
Parameters:
Data Structure: D0800013
Parameter Name Data Item Data Type I/O jdDateConvertdDate DRQJ JDEDATE O szStringToConvert VC10A String I
Back to Top Back to Summary Table
B0800208: ConvertStringDateToDateFormat
Purpose:
This function will convert a string that is in a date format to a Julian date (JDE format). The Date Mask passed as a literal to the function describes the format of the string date. For example, if the string date is in a format of 05/29/2002 the format mask to be passed to the function would be OSASE. If the date was in a format of 052902 the format mask would be OAR. See the information on the Date Masks Available for the available date masks.
Parameters:
Data Structure: D0800208
Parameter Name Data Item Data Type I/O jdConvertedDate DRQJ JDEDATE O szStringToConvert VC10A String I szFormatMask VC09A String I
Back to Top Back to Summary Table
B3000250: GetMonthDescription
Purpose:
This function will validate a two digit number entered within a range (1-12) and convert the 2-digit number to a string description of the month. (1=January, 2=February, 3=March, etc.). The function will return "Invalid Entry" if the input number is not in the range.
Parameters:
Data Structure: D3000250
Parameter Name Data Item Data Type I/O mnCalendarMonth MT Numeric I szDescription DESC String O
Note: To get the month description from a JDEDate:
- Call B9800460 to convert JDEDate to String (i.e. 12/20/05)
- Use the substr Expression Manager function to get the month in String format (i.e. 12)
- Call B4000770 to convert string to numeric to get a numeric calendar month (i.e. 12)
Back to Top Back to Summary Table
B3000260: GetYearDescription
Purpose:
This function will validate a number entered within a range (00-99) and convert a 2-digit number to a 4-digit description of the year. The function will combine the century and year and give the description (i.e. 19 + 98 = 1998).
If the year is less than or equal to the default value of DCYR data item, then century will be '20'
If the year is greater than the default value or DCYR data item, then century will be '19'
Parameters:
Data Structure: D3000260
Parameter Name Data Item Data Type I/O mnCalendarYear YR Numeric I szYearDescription DESC String O
Note: To get the year description from JDEDate:
- Call B9800460 to convert JDEDate to String (i.e. 12/20/05)
- Use substr Expression Manager function to get the year in String format (i.e. 05)
- Call B4000770 to convert string to numeric to get a numeric calendar year (i.e. 05)
Back to Top Back to Summary Table
B41B0470: FormatDateFromDMY
Purpose:
This business function will convert 3 numeric values (YY, MM, DD) to a Julian date (JDE format). One digit number on the input month and day is acceptable.
Parameters:
Data Structure: D41B0470
Parameter Name Data Item Data Type I/O mnYear YR MATH_NUMERIC I mnMonth MNTH MATH_NUMERIC I mnDay DOM MATH_NUMERIC I jdDate OPDT JDEDATE O
Special Instructions:
This business function calls B0000154.
If YY is greater than the default value of CENTCHG (DD item), the century is 19
If YY is less than the default value of CENTCHG (DD item), the century is 20
Back to Top Back to Summary Table
B7600920: ConvertNumbersAndDatesToString
Purpose:
This business function will convert a Julian date (JDE format) into a string DDMMYY format (0 pad for one digit day and month).
Parameters:
Data Structure: D7600920
Parameter Name Data Item Data Type I/O NumberToBeConverted
MATH01 MATH_NUMERIC I
DateToBeConverted DATE01 JDEDATE I TargetString REM1 STRING OLengthOfTargetString INT01 INTEGER I
Back to Top Back to Summary Table
B9100001: ConvertjulianDatetojdeDate
Purpose:
This business function will convert a Julian numeric date (JDE Julian Format of CYYDDD) to a Julian date (JDE format). The first digit of a Julian numeric date input represents century -- 0 for 19's, 1 for 20's, 2 for 21's, ....
Parameters:
Data Structure: D9800210
Parameter Name Data Item Data Type I/O jdDateToConvert TRDJ JDEDATE O mnJulinaDateInYYYYDDD CDL MATH_NUMERIC I
Back to Top Back to Summary Table
B9800210: Convert From and To Julian Date from JDEDATE
Purpose:
ConvertDateToJulian: This function will convert a Julian date (JDE format) to a Julian numeric date (YYYYDDD) Note: This Julian numeric date output is not in the JDE Julian Date format of CYYDDD, but rather in a YYYYDDD format.
ConvertJulianToDate: This function will convert Julian numeric date (YYYYDDD) to a Julian date (JDE format) Note: The input Julian numeric date should not be in the JDE Julian Date format of CYYDDD, but rather in a YYYYDDD format.
Parameters:
Data Structure: D9800210
ConvertDateToJulian:
Parameter Name Data Item Data Type I/O jdDateToConvert TRDJ JDEDATE I mnJulinaDateInYYYYDDD CDL* MATH_NUMERIC O
ConvertJulianToDate:
Parameter Name Data Item Data Type I/O jdDateToConvert TRDJ JDEDATE O mnJulinaDateInYYYYDDD CDL* MATH_NUMERIC I
*CDL is a 2 digit numeric data item. You might need to use other math numeric data items to pass in/out to the business function. To get the numeric field to print out on the report, display decimal and edit code need to be changed on the field.
Back to Top Back to Summary Table
B4500490: DateConversiontoJulian
Purpose:
This business function will convert a Julian date that is in JDE Date Format to a math numeric Julian date (JDE Julian Format of CYYDDD). The first digit of a Julian numeric date input represents century -- 0 for 19's, 1 for 20's, 2 for 21's, ....
Parameters:
Data Structure: D4500490
Parameter Name Data Item Data Type I/O jdDateToConvert TRDJ JDEDATE I mnJulianDateInYYYDDD
CDL MATH_NUMERIC O
Back to Top Back to Summary Table
B0000200: SixDigitNumerictoDate
Purpose:
This business function will convert a math numeric that is in JDE Julian format of CYYDDD to a Julian date in JDE Date Format. The first digit of a Julian numeric date input represents century -- 0 for 19's, 1 for 20's, 2 for 21's, ....
Parameters:
Data Structure: D0000200B
Parameter Name Data Item Data Type I/O
mnInputNumeric CHGH MATH_NUMERIC I jdOutputDate DATE01 JDEDATE O cReturnCode EV01 CHARACTER O
Special Note:
This Business Function is first available with Update 4 of J.D. Edwards software release Xe.
Back to Top Back to Summary Table
B0000200: DatetoSixDigitNumeric
Purpose:
This business function will convert a Julian date that is in JDE Date Format to a math numeric Julian date (JDE Julian Format of CYYDDD). The first digit of a Julian numeric date input represents century -- 0 for 19's, 1 for 20's, 2 for 21's, ....
Parameters:
Data Structure: D0000200A
Parameter Name Data Item Data Type I/O jdInputDate DATE01 JDEDATE I mnOutputNumeric CHGJ MATH_NUMERIC O cReturnCode EV01 CHARACTER O
Special Note:
This Business Function is first available with Update 4 of J.D. Edwards software release Xe.
Back to Top Back to Summary Table
B9800460: ConvertDateToString
Purpose:
ConvertDateToString: This business function will convert a Julian date (JDE format) into a string according to the selected MASK. Date Mask is defined in UDC 00/DF
Parameters:
Data Structure: D9800460A
Parameter Name Data Item Data Type I/O jdDateToConvert DRQJ JDEDATE I szDateConvertedToString VC08A STRING O szDateFormat FRMT* STRING I
*User can define the field by selecting Literal and doing a visual assist and you will get the choice below.
Date Mask available (UDC 00/DF)
Codes Description Appearance Use System Value Regional setting in control
panel DME Day, Month, 4-digit Year* DD/MM/YY DMY Day, Month, Year (DDMMYY) DD/MM/YY EMD 4-digit Year, Month, Day* YY/MM/DD MDE Month, Day, 4-digit Year* MM/DD/YY MDY Month, Day, Year (MMDDYY) MM/DD/YY YMD Year, Month, Day (YYMMDD) YY/MM/DD
*Special Note:
The business function ConvertStringToDate B9800460 was built for a very limited use and has a very restrictive format. It forces slashes between the day month and year, it requires a leading 0 for months and days that are a single digit, and it allows a date that is only 8 characters long. This prevents printing 4 digit years. A 4-digit year will be truncated into a 2-digit year.
Back to Top Back to Summary Table
N1700090: CalculateBeginDateofPeriod
Purpose:
This business function will return a period begin date, period end date, beginning date of the fiscal year, and/or the ending dates for all 14 periods of the fiscal year.
Parameters:
Data Structure: D1700090
Parameter Name Data Item Data Type I/O mnPeriodNo PN MATH_NUMERIC I cRetrieveF0008Records EV01 CHARACTER I szCompany CO STRING I mnCentury CTRY MATH_NUMERIC I mnFiscalYear1 FY MATH_NUMERIC I jdPeriodBeginDate DTEJ JDEDATE jdBeginDateofFiscalYear
DTEJ JDEDATE
jdPeriod1EndDate DTEJ JDEDATE jdPeriod2EndDate DTEJ JDEDATE jdPeriod3EndDate DTEJ JDEDATE jdPeriod4EndDate DTEJ JDEDATE jdPeriod5EndDate DTEJ JDEDATE jdPeriod6EndDate DTEJ JDEDATE jdPeriod7EndDate DTEJ JDEDATE jdPeriod8EndDate DTEJ JDEDATE jdPeriod9EndDate DTEJ JDEDATE jdPeriod10EndDate DTEJ JDEDATE jdPeriod11EndDate DTEJ JDEDATE jdPeriod12EndDate DTEJ JDEDATE jdPeriod13EndDate DTEJ JDEDATE jdPeriod14EndDate DTEJ JDEDATE cSuppressErrorMessage SUPPS CHARACTER I szErrorMessageID DTAI STRING O jdPeriodEndDate DTEJ JDEDATE O
Special Note:
This Business Function is first available with Update 4 of J.D. Edwards software release Xe.
Back to Top Back to Summary Table
Document ID
Document Title
Related Knowledge Documents
OTT-99-0016
Expression Manager Functions