Copyright 2007, Information Builders. Slide 1 What's New With Dates Renee Teatro Information Builders FUN Conference October 2009.

Slides:



Advertisements
Similar presentations
Copyright 2007, Information Builders. Slide 1 Dates and Functions Noreen Redden Information Builders, Inc.
Advertisements

1 That’s Not a Date-Time Datatype, Is It? Renee Teatro Information Builders Information Builders Summit 2006 User Conference April 2006.
Copyright  Oracle Corporation, All rights reserved. 2 Single-Row Functions.
Objectives After completing this lesson, you should be able to do the following: Describe various types of conversion functions that are available in.
Copyright © 2007, Oracle. All rights reserved Using Single-Row Functions to Customize Output Modified: October 21, 2014.
1 Chapter 9 - Formatted Input/Output Outline 9.1Introduction 9.2Streams 9.3Formatting Output with printf 9.4Printing Integers 9.5Printing Floating-Point.
Display a 12-Month Calendar CS-2301 D-term Programming Assignment #2 12-Month Calendar CS-2301 System Programming C-term 2009 (Slides include materials.
Databases Lab 5 Further Select Statements. Functions in SQL There are many types of functions provided. The ones that are used most are: –Date and Time.
Chapter 9 Formatted Input/Output Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 9 - Formatted Input/Output Outline 9.1Introduction.
 2007 Pearson Education, Inc. All rights reserved C Formatted Input/Output.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 9 - Formatted Input/Output Outline 9.1Introduction 9.2Streams 9.3Formatting Output with printf.
Assignment #2, 12- month Calendar CS-2301, B-Term Programming Assignment #2 12-Month Calendar CS-2301, System Programming for Non-Majors (Slides.
C Formatted Input/Output /* Using Integer Conversion Specifiers */ #include int main ( ) { printf( "%d\n", 455 ); printf( "%i\n", 455 ); printf( "%d\n",
 2007 Pearson Education, Inc. All rights reserved C Formatted Input/Output.
1 Chapter Two Using Data. 2 Objectives Learn about variable types and how to declare variables Learn how to display variable values Learn about the integral.
Storing data Getting data out Data types Ruby as a foundation Program Variables Click icon to hear comments (the download may take a minute)
Ch. 3 Single-Row Functions Important Legal Notice:  Materials on this lecture are from a book titled “Oracle Education” by Kochhar, Gravina, and Nathan.
Practical PHP IDIA Spring 2012 Bridget M. Blodgett.
Strings PART II STRING$ AND SPACE$. Create strings of specified number String$ creates string of specified character Space$ creates string of spaces Example:
3-1 Copyright  Oracle Corporation, All rights reserved. SQL Functions FunctionInput arg 1 arg 2 arg n Function performs action OutputResultvalue.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Streams Streams –Sequences of characters organized.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 9 - Formatted Input/Output Outline 9.1Introduction.
Chapter 9 Formatted Input/Output. Objectives In this chapter, you will learn: –To understand input and output streams. –To be able to use all print formatting.
Chapter 9 Formatted Input/Output Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
 Pearson Education, Inc. All rights reserved Formatted Output.
 2005 Pearson Education, Inc. All rights reserved Formatted Output.
Chapter 9 - Formatted Input/Output Outline 9.1Introduction 9.2Streams 9.3Formatting Output with printf 9.4Printing Integers 9.5Printing Floating-Point.
Noreen Redden FOCUS Users of New England 2012 FOCWizards and Focal Point Information Builders Off to See the Wizards 1.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Includes and Dates.
Computer Science 111 Fundamentals of Programming I Number Systems.
Said Salomon Unitrin Direct Insurance T-SQL Date and Time Functions Said Salomon.
3 Copyright © Oracle Corporation, All rights reserved. Single-Row Functions.
CH2 – Using Data. Constant Something which cannot be changed Data Type Format and size of a data item Intrinsic Data Types Pg. 47 – Table 2-1 Basic ones.
Input, Output, and Processing
CIS 338: Operators and Formatting in VB.NET Dr. Ralph D. Westfall April, 2011.
Chapter 2: Using Data.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
3 Copyright © 2004, Oracle. All rights reserved. Using Single-Row Functions to Customize Output.
Single – Row Functions. Objectives After completing this lesson, you should be able to do the following:  Describe various types of functions available.
Copyright © 2012 Pearson Education, Inc. Chapter 2: Introduction to C++
Characters and tokens Characters are the basic building blocks in C program, equivalent to ‘letters’ in English language Includes every printable character.
Single Row Functions Week 2. Objectives –Describe types of single row functions in SQL –Describe and use character, number, date, general and conversion.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 2: Introduction to C++
EXPRESSION Transformation. Introduction ►Transformations help to transform the source data according to the requirements of target system and it ensures.
Conversion Functions.
Single Row Functions. Objectives –Use character, number, and date functions –Use conversion functions –Describe types of single row functions in SQL.
Chapter 3 – Variables and Arithmetic Operations. Variable Rules u Must declare all variable names –List name and type u Keep length to 31 characters –Older.
Copyright  Oracle Corporation, All rights reserved. 3 Single-Row Functions.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
C++ for Everyone by Cay Horstmann Copyright © 2012 by John Wiley & Sons. All rights reserved Chapter Two: Fundamental Data Types Slides by Evan Gallagher.
Formatting Output. Formatting features of printf System.out.printf can perform the following Rounding floating-point values Aligning properly a column.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
An Introduction to Programming with C++ Sixth Edition Chapter 13 Strings.
Academic Year 2015 Autumn. MODULE CC2006NI: Data Modelling and Database Systems Academic Year 2015 Autumn.
A FIRST BOOK OF C++ CHAPTER 14 THE STRING CLASS AND EXCEPTION HANDLING.
Microsoft Access Prepared by the Academic Faculty Members of IT.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to C++
3 Copyright © 2004, Oracle. All rights reserved. Using Single-Row Functions to Customize Output.
INTRODUCTION TO DATABASE USING MICROSOFT ACCESS 2013 Part 5.1 November 16, 2014.
Single Row Functions Part I Week 2. Objectives –Describe types of single row functions in SQL –Describe and use character, number and date SQL functions.
4 Copyright © 2009, Oracle. All rights reserved. Using Conversion Functions and Conditional Expressions.
28 Formatted Output.
Chapter 9 - Formatted Input/Output
Open Source Server Side Scripting MySQL Functions
Chapter 9 - Formatted Input/Output
Date Functions Farrokh Alemi, Ph.D.
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
Presentation transcript:

Copyright 2007, Information Builders. Slide 1 What's New With Dates Renee Teatro Information Builders FUN Conference October 2009

Copyright 2007, Information Builders. Slide 2 What's New With Dates OVERVIEW  Review  Legacy vs. Smart Dates  Dialogue Manager and Dates  DATETIME  Functions  What's New  Functions  Displaying Dates  Date Manipulation

Copyright 2007, Information Builders. Slide 3 What's New With Dates Review – Legacy Dates Vs. Smart Dates Legacy Dates Dates Physically Stored As A Recognizable Date Determined By USAGE: A8YYMD (' ')A6YMD ('090317') I8YYMD ( ) I6YMD (090317)

Copyright 2007, Information Builders. Slide 4 What's New With Dates Review – Legacy Dates Vs. Smart Dates Legacy Dates Considerations CANNOT Do Date Arithmetic Can Be Used To Specify Date Range Only If The Format is A8YYMD or I8YYMD BEGDATE/I8YYMD= ; ENDDATE/I8YYMD= ; DIFFDAYS/I5=ENDDATE – BEGDATE; Result of DIFFDAYS: 100 DIFFDAYS=ENDDATE – BEGDATE; OPENDATE has USAGE of A8MDYY and VALUE of ' ' WHERE OPENDATE GE ' ' Will OPENDATE of Show In The Output? YES – A String Starting With 05 Is Greater Than a String Starting with 01

Copyright 2007, Information Builders. Slide 5 What's New With Dates Review – Legacy Dates Vs. Smart Dates Smart Dates Dates Physically Stored As The OFFSET of Days From 1900/12/31 Determined By USAGE: YYMD YYMD (39523)YMD (39523) What Is Stored If The FORMAT is YMD and the VALUE is ? How Does FOCUS Know If The Value Is or ? DEFCENT and YRTHRESH: DEFCENT = 19 and YRTHRESH <= year use DEFCENT DEFCENT = 19 and YRTHRESH > year use DEFCENT

Copyright 2007, Information Builders. Slide 6 What's New With Dates Review – Legacy Dates Vs. Smart Dates Converting Dates With DEFINE or COMPUTE Legacy to Smart: NEWDATE/MDYY=LEGACYDATE; Smart to Legacy: NEWDATE/A8YMD=SMARTDATE; Why Convert? To Perform Date Arithmetic To Screen Data Not in YYMD format

Copyright 2007, Information Builders. Slide 7 What's New With Dates Review – Dialogue Manager There Are No Date Formats In Dialogue Manager A Date Must Be Converted To A Smart Date Using The DATECVT Subroutine, Perform Calculation. If Necessary, Convert Back To A Legacy Date.

Copyright 2007, Information Builders. Slide 8 What's New With Dates Review – Dialog Manager Example: Calculate the number of days from now until Halloween. -SET &THISYEAR = EDIT(&YYMD,'9999'); -SET &THISHALL = &THISYEAR | '1031'; -* CONVERT DATES TO SMARTDATES -SET &STODAY = DATECVT(&YYMD,'I8YYMD','YYMD'); -SET &SHALLOW = DATECVT(&THISHALL,'I8YYMD','YYMD'); -* SUBTRACT THE 2 SMART DATES TO GET DIFFERENCE -SET &DAYSTOHALL = &SHALLOW - &STODAY; -TYPE DAYS TO HALLOWEEN: &DAYSTOHALL Output of &ECHO=ALL: 1. -SET &THISYEAR = EDIT( ,'9999'); 2. -SET &THISHALL = 2009 | '1031'; 3. -* CONVERT DATES TO SMARTDATES 4. -SET &STODAY = DATECVT( ,'I8YYMD','YYMD'); 5. -SET &SHALLOW = DATECVT( ,'I8YYMD','YYMD'); 6. -* SUBTRACT THE 2 SMART DATES TO GET DIFFERENCE 7. -SET &DAYSTOHALL = ; 8. -TYPE DAYS TO HALLOWEEN: DAYS TO HALLOWEEN: 195

Copyright 2007, Information Builders. Slide 9 What's New With Dates Review – DATETIME formats Dependent On The Adapter FOCUS FORMAT=H17 can store: YYYYMMDDHHMMSSsss (millisecond) FORMAT=H20 can store: YYYYMMDDHHMMSSsssmmm (microsecond)

Copyright 2007, Information Builders. Slide 10 What's New With Dates Review – DATETIME formats Oracle - TIMESTAMP USAGE=HYYMDS, ACTUAL=HYYMDS stores: YYYYMMDDHHMMSS 2008/01/01 13:59:23 USAGE=HYYMDs, ACTUAL=HYYMDs stores: YYYYMMDDHHMMSSsss 2008/01/01 13:59: USAGE=HYYMDm, ACTUAL=HYYMDm stores: YYYYMMDDHHMMSSsssmmm 2008/01/01 13:59:

Copyright 2007, Information Builders. Slide 11 What's New With Dates Review – DATETIME formats MS SQL Server DATETIME USAGE=HYYMDs, ACTUAL=HYYMDs stores: YYYYMMDDHHMMSSsss (milliseconds) range: 1/1/1753 to 12/31/9999 Why 1753?

Copyright 2007, Information Builders. Slide 12 What's New With Dates Review – DATETIME formats DB2 TIMESTAMP USAGE=HYYMDm, ACTUAL=HYYMDm stores: YYYYMMDDHHMMSSsssmmm (microseconds)

Copyright 2007, Information Builders. Slide 13 FormatDisplayStorage A6YMD05/01/ A8YYMD2005/01/ I6YMD05/01/31Binary(50131) P6YMD05/01/31Packed(50131) I8YYMD2005/01/31Binary( P8YYMD2005/01/31Packed( ) YMD05/01/ or * YYMD2005/01/ HYYMDS2005/01/31 05:4500Binary * SET YRTHRESH=50 What's New With Dates Review – Formats

Copyright 2007, Information Builders. Slide 14 DATECVT converts the format of a date in an application without requiring an intermediate calculation DATEADD function adds a unit to or subtracts a unit from a date format HDTTM function converts a date value to a date ‑ time field HPART function extracts a specified component from a date ‑ time value and returns it in numeric format HINPUT function converts an alphanumeric string to a date ‑ time value. HDIFF function calculates the number of units between two date-time values What's New With Dates Review – Functions

Copyright 2007, Information Builders. Slide 15 DATECVT(date, 'infmt', 'outfmt'[, outfield]) Converts the format of a date in an application without requiring an intermediate calculation DATECVT(HIRE_DATE, 'I6YMD', 'YYMD') where: date - Is the date to be converted. If you supply an invalid date, DATECVT returns zero. When the conversion is performed, a legacy date obeys any DEFCENT and YRTHRESH parameter settings supplied for that field. infmt - Alphanumeric Is the format of the date enclosed in single quotation marks. It is one of the following: A non-legacy date format (for example, YYMD, YQ, M, DMY, JUL). A legacy date format (for example, I6YMD or A8MDYY). A non-date format (such as I8 or A6). A non-date format in infmt functions as an offset from the base date of a YYMD field (12/31/1900). outfmt - Alphanumeric Is the output format enclosed in single quotation marks. It is one of the following: A non-legacy date format (for example, YYMD, YQ, M, DMY, JUL). A legacy date format (for example, I6YMD or A8MDYY). A non-date format (such as I8 or A6). A non-date format in infmt functions as an offset from the base date of a YYMD field (12/31/1900). Outfield - Alphanumeric Is the field that contains the result. This value is required only for Maintain. What's New With Dates Review – Functions

Copyright 2007, Information Builders. Slide 16 DATEADD(date, 'unit', #units[, outfield]) Function adds a unit to or subtracts a unit from a date format DATEADD(NEW_DATE, 'WD', 3) where: date - Is any day-based non-legacy date, for example, YYMD, MDY, or JUL. unit – Alphanumeric Is one of the following enclosed in single quotation marks: Y indicates a year unit. M indicates a month unit. D indicates a day unit. WD indicates a weekday unit. BD indicates a business day unit. #units – Integer Is the number of date units added to or subtracted from date. If this number is not a whole unit, it is rounded down to the next largest integer. outfield – Alphanumeric Is the field that contains the result. This value is required only for Maintain. What's New With Dates Review – Functions

Copyright 2007, Information Builders. Slide 17 HDTTM(date, length, outfield) Function converts a date value to a date ‑ time field HDTTM(TRANSDATE_DATE, 8, 'HYYMDIA') where: date - Is the date value to be converted, the name of a date field that contains the value, or an expression that returns the value. length - Is the length of the returned date ‑ time value. Valid values are: 8 indicates a time value that includes milliseconds. 10 indicates a time value that includes microseconds. Outfield - Alphanumeric Is the field that contains the result, or the format of the output value enclosed in single quotation marks. The format must be in date-time format (data type H). In FOCUS, you must specify the format. In Maintain, you must specify the name of the field. What's New With Dates Review – Functions

Copyright 2007, Information Builders. Slide 18 HPART(value, 'component', outfield) Function extracts a specified component from a date ‑ time value and returns it in numeric format HPART(TRANSDATE, 'DAY', 'I2') where: value - Is a date ‑ time value, the name of a date ‑ time field that contains the value, or an expression that returns the value. component - Is the name of the component to be retrieved enclosed in single quotation marks. See Arguments for Use With Date and Time Functions for a list of valid components. Outfield - Numeric Is the field that contains the result, or the integer format of the output value enclosed in single quotation marks. In FOCUS, you must specify the format. In Maintain, you must specify the name of the field. What's New With Dates Review – Functions

Copyright 2007, Information Builders. Slide 19 HINPUT(inputlength, 'inputstring', length, outfield) Function converts an alphanumeric string to a date ‑ time value HINPUT(14, ALPHA_DATE_TIME, 8, 'HYYMDS') where: inputlength Is the length of the alphanumeric string to be converted. You can supply the actual value, the name of a numeric field that contains the value, or an expression that returns the value. inputstring Is the alphanumeric string to be converted enclosed in single quotation marks, the name of an alphanumeric field that contains the string, or an expression that returns the string. The string can consist of any valid date ‑ time input value as described in Describing Data. length Is the length of the returned date ‑ time value. Valid values are: 8 indicates a time value that includes milliseconds. 10 indicates a time value that includes microseconds. outfield - Alphanumeric Is the field that contains the result, or the format of the output value enclosed in single quotation marks. The format must be in date-time format (data type H). In FOCUS, you must specify the format. In Maintain, you must specify the name of the field. What's New With Dates Review – Functions

Copyright 2007, Information Builders. Slide 20 HDIFF(value1, value2, 'component', outfield) function calculates the number of units between two date-time values HDIFF(ADD_MONTH, TRANSDATE, 'DAY', 'D12.2') where: value1 - Is the end date ‑ time value, the name of a date ‑ time field that contains the value, or an expression that returns the value. value2 - Is the start date ‑ time value, the name of a date ‑ time field that contains the value, or an expression that returns the value. component - Is the name of the component to be used in the calculation enclosed in single quotation marks. If the component is a week, the WEEKFIRST parameter setting is used in the calculation. outfield - Alphanumeric Is the field that contains the result, or the format of the output value enclosed in single quotation marks. The format must be floating-point double-precision. In FOCUS, you must specify the format. In Maintain, you must specify the name of the field. What's New With Dates Review – Functions

Copyright 2007, Information Builders. Slide 21 The following component names and values are supported as arguments for the date ‑ time functions that require them: Component Name Valid Values year 0001 ‑ 9999 quarter 1 ‑ 4 month 1 ‑ 12 day ‑ of ‑ year 1 ‑ 366 day or day ‑ of ‑ month 1 ‑ 31 (The two names for the component are equivalent.) week 1 ‑ 53 weekday 1 ‑ 7 (Sunday ‑ Saturday) hour 0 ‑ 23 minute 0 ‑ 59 second 0 ‑ 59 millisecond 0 ‑ 999 microsecond 0 ‑ Arguments for Use With Date and Time Functions What's New With Dates Review – Functions

Copyright 2007, Information Builders. Slide 22 TIME Functions HHMMSS – retrieves the current time DATETIME Functions HADD – increments a date-time value HDATE – converts the date portion of a date-time value to a date format HGETC – retrieves the current date and time in a date-time field HNAME – retrieves a date-time component in alphanumeric format HTIME – extracts the time portion of a date-time value to a number HYYWD– returns the year and week number from a date-time value DATE Functions DATEDIF – finding the difference between two dates TODAY– returns the current date DATEMOV – moving a date to a significant point DATETRAN – format dates in international formats What's New With Dates

Copyright 2007, Information Builders. Slide 23 HHMMSS(outfield) Retrieves the current time HHMMSS('A8') CURTIME/A8=HHMMSS('A8'); Output: where: outfield – Alphanumeric, at least 8 characters Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks. In Dialogue Manager you must specify the format. In Maintain, you must specify the name of the field. What's New With Dates TIME Functions

Copyright 2007, Information Builders. Slide 24 HADD(infield, 'component', increment, length, outfield) Increments A Date-Time Value HADD(TRANSDATE,'MONTH',1,8,'HYYMDS') where: infield – Date-Time Is the date-time value to be incremented, the name of a date-time field that contains the value or an expression that returns the value. component – Alphanumeric Is the name of the component to be incremented enclosed in single quotation marks. See Arguments for Use With Date and Time Functions for a list of valid components. increment – Integer Is the number of units by which to increment the component, the name of a numeric field that contains the value, or an expression that returns the value. length – Integer Is the length of the returned date-time value. Valid values are: 8 indicates a time value that includes milliseconds 10 indicates a time value that includes microseconds outfield – Date-Time Is the field that contains the result, or the format of the output value enclosed in single quotation marks. It must be a DATE-TIME format. In Maintain, the name of the field is required. What's New With Dates DATETIME Functions

Copyright 2007, Information Builders. Slide 25 HADD example Input date of STDATE is 2008/09/23 15:30: STDATE plus 2 months is derived using: STDATEP2M/HYYMDs=HADD(STDATE,'MONTH',2,10,'HYYMDs'); The result is: 2008/11/23 15:30: What's New With Dates DATETIME Functions

Copyright 2007, Information Builders. Slide 26 HDATE(value, '(YYMD)', outfield) Converts the date portion of a Date-Time field to a Date value HDATE(DATETIMEFLD,outfield) where: value – Date-Time Is the date-time value to be converted, the name of a date-time field that contains the value, or an expression that returns the value. outfield – YYMD For Maintain, this is the name of the output field otherwise it will be YYMD. What's New With Dates DATETIME Functions HADD example: Input date of STDATE is 2008/09/23 15:30: DATEONLY/YYMD=HDATE(STDATE,'YYMD'); The result is: 2008/09/23

Copyright 2007, Information Builders. Slide 27 HGETC(length, outfield) Stores current date-time into a date-time field. HGETC(8, 'HYYMDs') where: length – Integer Is the length of the returned date-time value. Valid values are: 8 – indicates a time value that includes milliseconds 10 – indicates a time value that includes microseconds outfield – date-time Is the field that contains the result, or format or the output value enclosed in single quotation marks. The format must be in date-time format (data type H). In Maintain, you must specify the name of the field. What's New With Dates DATETIME Functions HGETC example: CURRDATETIME/HYYMDs=HGETC(10,'HYYMDs'); The result is: 2009/04/21 09:32:35.215

Copyright 2007, Information Builders. Slide 28 HTIME(length, value, outfield) Converts the time portion of a datetime value to a value HTIME(8,TRANSDATE, 'D12.2') where: length – Integer Is the length of the input date ‑ time value. Valid values are: 8 indicates a time value that includes milliseconds. 10 indicates a time value that includes microseconds. value – Date-Time Is the date-time value from which to convert the time, the name of a date-time field that contains the value, or an expression that returns the value. outfield – Floating Point or Double Precision number Is the field that contains the result, or the format of the output value enclosed in single quotation marks. The format must be floating point or double precision. In Maintain, you must specify the name of the field. What's New With Dates DATETIME Functions

Copyright 2007, Information Builders. Slide 29 HNAME(value, 'component', outfield) Function extracts a specified component from a date ‑ time value and returns it in alphanumeric format HNAME(TRANSDATE, 'DAY', 'A20') where: value - Is a date ‑ time value, the name of a date ‑ time field that contains the value, or an expression that returns the value. component - Is the name of the component to be retrieved enclosed in single quotation marks. See Arguments for Use With Date and Time Functions for a list of valid components. Outfield – Alphanumeric, at least A2 Is the field that contains the result, or the alphanumeric format of the output value enclosed in single quotation marks. In Maintain, you must specify the name of the field. The function converts all the other components to strings of digits only. The year is always four digits and the hour assumes the 24-hour system. What's New With Dates DATETIME Functions

Copyright 2007, Information Builders. Slide 30 HNAME example Input date of STDATE is 2008/09/23 15:30: Extracting Month from date-time: STDATEP2M/HYYMDs=HADD(STDATE,'MONTH',2,10,'HYYMDs'); The result is: 2008/11/23 15:30: What's New With Dates DATETIME Functions

Copyright 2007, Information Builders. Slide 31 HADD example Input date of STDATE is 2008/09/23 15:30: STDATE plus 2 months is derived using: EXTMONTH/A20=HNAME(STDATE, 'MONTH', 'A20'); The result is: SEP What's New With Dates DATETIME Functions

Copyright 2007, Information Builders. Slide 32 HYYWD(dtvalue, outfield) Returns the year and week number from a date-time value HYYWD(OPEN_DT, 'A10') 2008/09/23 15:30: where: Output: 2008-W38-4 dtvalue – date-time Is the date-time value to be edited, the name of a date-time field that contains the value, or, or an expression that returns the value. outfield - Alphanumeric Is the field that contains the result, or the format of the output value enclosed in single quotation marks. The field must be at least 10 characters long. The output is in the following format: yyyy-Www-d where: yyyy – is the four digit year ww – is the two digit week number (01 – 53) d – is the single digit day of the week (1 to 7). The d value is relative to the current WEEKFIRST setting. If WEEKFIRST is 2 or ISO2 (Monday), then Monday is represented in the output as 1, Tuesday as 2. Using the EDIT function, you can extract the individual subfields from this output. What's New With Dates DATETIME Functions

Copyright 2007, Information Builders. Slide 33 DATEDIF(from_date, to_date, 'unit', outfield) Calculates the number of units between two date-time values DATEDIF(BEGDATE,ENDDATE, 'M',, 'D12.2') where: from_date – Date Is the start date from which to calculate the difference. to_date – Date Is the end date from which to calculate the difference. unit – Alphanumeric Is one of the following enclosed in single quotation marks: Y for yearWD for weekday M for monthBD for business day D for day outfield - Numeric Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks. In Maintain, you must specify the name of the field. What's New With Dates DATE Functions

Copyright 2007, Information Builders. Slide 34 TODAY(outfield) Returns the current date TODAY('A8') where: outfield – Alphanumeric, at least A8 Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks. The following apply: If DATEFNS=ON and the format is A8 or A9, TODAY returns the 2 digit year If DATEFNS=ON and the format is A10 or greater, TODAY returns the 4 digit year If DATEFNS=OFF, TODAY returns the 2 digit year, regardless of the format of outfield In Dialogue Manager, you must specify the format. In Maintain, you must specify the name of the field. What's New With Dates DATE Functions

Copyright 2007, Information Builders. Slide 35 DATEMOV(date, 'move-point') Moves a date to a significant point DATEMOV(OPENDATE,'BOM') where: from_date – Date Is the date to be moved. move-point – Alphanumeric Is the significant point the date is moved to enclosed in single quotation marks. An invalid point results in a return code of zero. Valid values are: EOM – end of monthNWD – next weekday BOM – beginning of monthNBD – next business day EOQ – end of quarterPWD – prior weekday BOQ – beginning of quarterPBD – prior business day EOY – end of yearWD- – weekday or earlier BOY – beginning of yearBD- – business day or earlier EOW – end of weekWD+ - weekday or later BOW – beginning of weekBD+ - business day or later Business day calculations are affected by BUSDAYS and HDAY. What's New With Dates DATE Functions

Copyright 2007, Information Builders. Slide 36 DATETRAN(indate, '(intype)', '(formatopts)', 'lang', outlen, outfield) Formats dates in International formats DATETRAN(DATEFIELD, '(MDYY)', '(wrctrdo)', 'EN', 150, FMTDATE) will print: Tuesday, March 17th 2009 where: indate – Date Is the date to be formatted. intype – Alphanumeric Is the format that the date will be displayed in. formatopts – Alphanumeric Identifies the formatting to take place. Suppression formats m – Zero suppresses months (display numeric months before October as 1 to 9 rather than 01 through 09). d – Zero suppresses days. dp – same as d with a period after the day do – Zero suppresses days, for English will print the ordinal suffix after the number. What's New With Dates DATE Functions

Copyright 2007, Information Builders. Slide 37 formatopts – continued Month and Day Name translations: T – displays month abbreviated, all uppercase, no punctuation. (JAN) TR – display full month, all uppercase. (JANUARY) Tp – same as T with a period after the abbreviated month. (JAN.) t – displays abbreviated month, no punctuation, first character is capital based on language setting. (Jan) tr – displays full month, all lowercase, first character uppercase based on language setting. (January) tp – same as t with period after abbreviated month. (Jan.) W – abbreviated day of the week name before the displayed date, all upper case, no punctuation. (TUE) WR – full day of week before the date, all uppercase. (TUESDAY) Wp – same as W with period after abbreviated weekday. (TUE.) w – abbreviated day of week, lowercase, first character capital based on language setting. (Tue) wr – full day of week, all lowercase, first character capital based on language setting. (Tuesday) wp – same as w with period after abbreviated weekday. (Tue.) What's New With Dates DATE Functions

Copyright 2007, Information Builders. Slide 38 formatopts – continued X – displays abbreviated day of the week at the end of the displayed date, all uppercase, no punctuation. (WED) XR – display full day of the week after date, all uppercase. (WEDNESDAY) Xp – same as X with a period after the abbreviated weekday. (WED.) x – displays abbreviated weekday after date, no punctuation, first character is capital based on language setting. (Wed) xr – displays full weekday after date, all lowercase, first character uppercase based on language setting. (Wednesday) xp – same as x with period after abbreviated weekday. (Wed.) Delimiter options: B – use a blank as delimiter. Default for month or day of week.. – use a period as delimiter - – use a minus sign as delimiter. This is the default when conditions for a blank are not satisfied. / – use a slash as the delimiter | – omits delimiters K – Use comma after month name, comma space after the day name What's New With Dates DATE Functions

Copyright 2007, Information Builders. Slide 39 formatopts – continued c – places comma after the month name, or comma blank after day name. e – displays the Spanish or Portuguese word de or DE between the day and month and between the month and year. D –Inserts comma after the day name and before the general delimiter Y – Inserts a comma after the year and before the general delimiter lang – Alphanumeric the two character standard ISO code for the language into which the date should be translated, enclosed in single quotation marks. Valid language codes are: AR ArabicEL GreekPO Polish CS CzechIW HebrewPT Portuguese DA DanishIT ItalianRU Russian DE GermanJA JapaneseSV Swedish EN EnglishKO KoreanTH Thai ES SpanishLT LithuanianTW Chinese (Traditional) FI FinnishNL DutchZH Chinese (Simplified) FR FrenchNO Norwegian What's New With Dates DATE Functions

Copyright 2007, Information Builders. Slide 40 outlen – Numeric The length of the output field in bytes. If the length is insufficient, an all blank result is returned. If the length is greater than required, the field is padded with blanks on the right. output – Alphanumeric Is the name of the field that contains the translated date, or it format enclosed in single quotation marks. What's New With Dates DATE Functions

Copyright 2007, Information Builders. Slide 41 Questions? What's New With Dates Thank you for coming!