Date()

 <  Day Day Up  >  

Date()

Category: Date

Syntax: Date ( month ; day ; year )

Parameters: month ”the month of the year (a number from 1 to 12); day ”the day of the month (a number from 1 to 31); year ”the year (four digits between 0001 and 4000).

Description: Returns a valid date of data type date represented by the three parameters. The Year parameter should be passed as a four-digit number.

Values for month and day outside of normal ranges will be interpreted correctly. For instance, a month value of 13 returns a date in January of the following year. A day value of 0 returns the last day of the preceding month.

Examples:

 

 Date ( 1 ; 1 ; 2000 ) 

Returns January 1, 2000 (formatting is determined on the layout).

Math can be performed on dates:

 

 Date( 1 ; 1 ; 2000 ) - 1 

Returns December 31, 1999 .

The parameters in a Date function can be calculated:

 

 Date ( Month ( Get ( CurrentDate )) ; 1 ; Year ( Get ( CurrentDate ))) 

Returns the date of the first of the current month; if today is August 12, 1965, then August 1, 1965 is returned.

The parameters in a Date function can be fields:

 

 Date ( pickMonth ; 1 ; Get ( CurrentDate )) 

Returns the date of the first of a month specified by the value in the field pickMonth .

Comments:

Parameters to date functions can be calculation expressions or fields; as long as the final result is valid, the date function will work correctly. Dates are stored internally as numbers (a unit of "1" represents one day); whole number math can be done on dates.

Be sure when returning dates as the result of calculation fields that you specify a calculation result of Date . If you were to define a field as Date ( 1 ; 1 ; 2000) and were to set the calculation result as Number , then you would see 730120 as the calculation value. Internally, FileMaker stores dates as the number of days since January 1, 0001, and that internal representation is returned if you incorrectly specify the return data type.

 <  Day Day Up  >  


QUE CORPORATION - Using Filemaker pro X
QUE CORPORATION - Using Filemaker pro X
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 494

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net