Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

YEAR

This function returns the year of a date or dateTime value. The year is returned as a number in the range 1 - 9999.

Syntax

Panel
bgColorwhite

WORKINGDAYS BETWEEN

WORKINGDAYS_BETWEEN


Calculates This function calculates the working days between two date or dateTime objects. It returns the number of full working days between two dates or dateTimes. The default working days are Monday, Tuesday, Wednesday, Thursday and Friday. This default can be overridden by supplying a list with alternative working days.


Syntax

Code Block
WORKINGDAYS BETWEEN startDate AND endDate
WORKINGDAYS_BETWEEN ( startDate, endDate, workingDays )



Inputs
  • date1 - The date or dateTime value that represents the start date.

  • date2 - The date or dateTime value that represents the end date.

  • workingDays - A list containing alternative working days. Note that the days should be specified as returned by the Date and time function: WORKINGDAYS BETWEEN function DAYOFWEEK function, e.g. Sunday = 1, Monday = 2 etc.

Info
UI Text Box
typenote

The order in which the dates are placed is irrelevant.YEARS  WORKINGDAYS_BETWEEN date1 AND date2 = YEARS WORKINDAYS_BETWEEN date2 AND date1. Also note that the time component of a datetime value is ignored, similar to the DAYS BETWEEN function.

Return type

  • integer


Examples

ExpressionResultTypeNote
WORKINGDAYS BETWEEN DATE( 2015 , 1 , 1 ) AND DATE( 2015 , 2 , 1 )22Integer
WORKINGDAYS_BETWEEN ( DATE ( 2015 , 1 , 1 ) , DATE ( 2015 , 2 , 1 ) , [ 3, 4, 5, 6, 7 ] )23IntegerWork week Tuesday - Saturday
WORKINGDAYS_BETWEEN ( DATE ( 2015 , 1 , 1 ) , DATE ( 2015 , 2 , 1 ) , [ 2, 3, 4, 5 ] )17Integer4 day work week Monday - Thursday

WORKINGDAYS BETWEEN DATE ( 2015 , 6 , 1 )

AND DATETIME ( 2015 , 6 , 2 , 12 , 0 , 0 )

1IntegerTime is ignored

WORKINGDAYS BETWEEN DATETIME ( 2015 , 5 , 29, 12 , 0 , 0 )

AND DATE ( 2015 , 5 , 31 )

1Integer

Time is ignored

30-5 and 31-5 are Saturday

and Sunday
Back to top
Panel
bgColorwhite
Code Block
YEAR ( date | dateTime )
Inputs
  • date or dateTime - The date or dateTime value of which the year must be returned.

Return type

  • integer

Examples

ExpressionResultTypeYEAR ( DATE ( 2015 , 01 , 01 ) )2015IntegerYEAR ( DATE ( 1978 , 04 , 11 ) )1978Integer

Back to top

Panel
bgColorwhite

MONTH

This function returns the month of a date or dateTime value. The month is returned as a number in the range 1 - 12.

Syntax

Code Block
MONTH ( date | dateTime )
Inputs
  • date or dateTime - The date or dateTime value of which the month must be returned.

Return type

  • integer

Examples

ExpressionResultTypeMONTH ( DATE ( 2015 , 01 , 01 ) )1IntegerMONTH ( DATE ( 1978 , 04 , 11 ) ) 4Integer Include Page_nav_BackToTop_nav_BackToTop Panel
bgColorwhite

DAY

This function returns the day of a date or dateTime value. The day is returned as a number in the range 1 - 31.

Syntax

Code Block
DAY ( date | dateTime )
Inputs
  • date or dateTime - The date or dateTime value of which the day must be returned.

Return type

  • integer

Examples

ExpressionResultTypeDAY ( DATE ( 2015 , 01 , 01 ) )1IntegerDAY ( DATE ( 1978 , 04 , 11 ) )11Integer
Back to top
Panel
bgColorwhite

HOUR

This function returns the hour of a dateTime value. The hour is returned as a number in the range 0 - 23.

Syntax

Code Block
HOUR ( dateTime )
Inputs
  • dateTime - The dateTime value of which the hour must be returned.

Return type

  • integer

Examples

ExpressionResultTypeHOUR ( DATETIME ( 2015 , 5 , 25 , 00 , 00 , 00 ) )0IntegerHOUR ( DATETIME ( 2015 , 5 , 25 , 23 , 00 , 00 ) )23Integer

Back to top

Panel
bgColorwhite

MINUTE

This function returns the minute of a dateTime value. The minute is returned as a number in the range 0 - 59.

Syntax

Code Block
MINUTE ( dateTime )
Inputs
  • dateTime - The dateTime value of which the minute must be returned.

Return type

  • integer

Examples

ExpressionResultTypeMINUTE ( DATETIME ( 2015 , 5 , 25 , 00 , 00 , 00 ) )0IntegerMINUTE ( DATETIME ( 2015 , 5 , 25 , 23 , 45 , 00 ) )45Integer

Back to top

Panel
bgColorwhite

SECOND

This function returns the second of a dateTime value. The second is returned as a number in the range 0 - 59.

Syntax

Code Block
SECOND ( dateTime )
Inputs
  • dateTime - The dateTime value of which the second must be returned.

Return type

  • integer

Examples

ExpressionResultTypeSECOND ( DATETIME ( 2015 , 5 , 25 , 00 , 00 , 00 ) )0IntegerSECOND ( DATETIME ( 2015 , 5 , 25 , 23 , 45 , 59 ) )59Integer

Back to top

Panel
bgColorwhite

TODAY

This function returns the current date of the server. The date is given as base type date, formatted as dd-mm-yyyy.

Syntax

Code Block
TODAY

Return type

  • date
UI Text Box
typenote
The TODAY function returns a date stamp. It is only recalculated when the expression in which you use the TODAY function is reevaluated. This recalculation will not cause other expressions that use the TODAY function to be reevaluated.

Back to top

Panel
bgColorwhite

NOW

This function returns the current date and time of the server. The date and time are given as base type dateTime, formatted as dd-mm-yyyy HH:mm:ss.

Syntax

Code Block
NOW

Return type

  • dateTime
UI Text Box
typenote
The NOW function returns a date- and timestamp. It is only recalculated when the expression in which you use the NOW function is reevaluated. This recalculation will not cause other expressions that use the NOW function to be reevaluated.

Back to top

...

bgColorwhite

WEEKNUMBER

This function returns the week number within the year of a given date or dateTime value. The week number is returned as an integer in the range 1 - 53. Week 1 for a year is the earliest seven day period starting at Monday that contains at least 4 days from that year. This definition reflects the ISO 8601 Week dates definition.

...

and

...

Syntax

Code Block
WEEKNUMBER ( date | dateTime )

Inputs

  • date or dateTime - The date or dateTime value of which the week number must be returned.

Return type

  • integer

Examples

...

Back to top

...

bgColorwhite

DAYOFWEEK

...

Sunday

...

Code Block
DAYOFWEEK ( date | dateTime )

...

  • date or dateTime - The date or dateTime value of which the week number must be returned.

...

  • integer
Examples

...

Back to top