Home Search

DriveWorks Pro 21
New Functions

Send Feedback

What's New - New Functions

  • Over 30 new functions have been added to DriveWorks 8
  • Each and every function has the new Rules Insight available for real time help
  • Each and every function has a wizard to help construct the function 

Date

This function returns the current date at the time it is called.

Syntax

DATE()

Examples

Rule

Meaning
DATE()

If this function is called on the 12th August 2009 then it would return the value: "12/08/2009".

The format the date is returned will depend on the system settings of the computer performing the calculation.

DateValue

This function returns the system date value for the given date.

Syntax

DATEVALUE()

Examples

Rule

Meaning
DATEVALUE("09/21/2010") This will return the system value 40442 for the given date
DATEVALUE(DATE()) If this function is called on the 11th October 2010 then it would return the value: 40462.


Day

This function returns the day number from the given value

Syntax

DAY()

Examples

Rule

Meaning
DAY() If this function is called on the 11th October 2010 then it would return the value: 11.
DAY(40462) This will return 11 from the given system date value
DAY("09/21/2010") This will return 21 from the given date


Hour

This function returns the hour, a number from 0 to 23,  from the given value.

Syntax

HOUR()

Examples

Rule

Meaning
HOUR(NOW()) If this function is called at the time of 13.20 then it would return the value: 13.
HOUR(0.555) This will return 13 from the given system time value


Minute

This function returns the minute, a number from 0 to 59, from the given value.

Syntax

MINUTE()

Examples

Rule

Meaning
MINUTE(NOW()) If this function is called at the time of 13.20 then it would return the value: 20.
MINUTE("16:19:22") This will return 19 from the given time value


Month

This function returns the month number from the given value

Syntax

MONTH()

Examples

Rule

Meaning
MONTH(DATE()) If this function is called on the 12th August 2009 then it would return the value: 8
MONTH("11 OCTOBER 2010") This will return 10 from the given date.


Second

This function returns the second, a number from 0 to 59, from the given value.

Syntax

SECOND()

Examples

Rule

Meaning
SECOND(NOW()) If this function is called at the time of 13.20:47 then it would return the value: 47.
SECOND("16:28:10") This will return 10 from the given time value


TimeValue

This function converts the given time to a serial number value

Syntax

TIMEVALUE()

Examples

Rule

Meaning
TIMEVALUE(NOW()) If this function is called at the time of 13.17:02 it will return the system value 0.553496458334848.
TIMEVALUE("16:25:21") This will return the system value 0.684270833 for the given time.


NetWorkDays

This function returns the number of work days between the given dates

Syntax

NETWORKDAYS([StartDate],[EndDate],[Holidays])

StartDate is the date to start counting the work days from. Date format must be month/date/year.

EndDate is the date to count the work days to. Date format must be month/date/year.

Holidays are the dates to exclude from the returned number of work days.. Date format must be month/date/year.

Examples

Rule

Meaning
NETWORKDAYS("10/08/2010","10/30/2010","10/12/2010") This will count all the work days in between 10/08/2010 and 10/30/2010, but exclude the day of 10/12/2010 and will return 15
NETWORKDAYS("10/08/2010","10/30/2010","10/12/2010","10/13/2010") This will count all the work days in between 10/08/2010 and 10/30/2010, but exclude the days of 10/12/2010 and 10/13/2010 and will return 14


NetWorkDaysCustom

This function returns the number of work days between the given dates, allowances for which days are weekend days and holidays are

Syntax

NETWORKDAYSCUSTOM([StartDate],[EndDate],[WeekendValue],[Holidays])

StartDate is the date to start counting the work days from. Date format must be month/date/year.

EndDate is the date to count the work days to. Date format must be month/date/year.

WeekendValue is a number (from the chart below) that represents the days to count as weekend days

Holidays are the dates to exclude from the returned number of work days.. Date format must be month/date/year.

Weekend Value

Weekend Days
1 or Omitted Saturday, Sunday
2Sunday, Monday
3Monday, Tuesday
4Tuesday, Wednesday
5Wednesday, Thursday
6Thursday, Friday
7Friday, Saturday
11Sunday only
12Monday only
13Tuesday only
14Wednesday only
15Thursday only
16Friday only
17Saturday only

Holidays

Examples

Rule

Meaning
NETWORKDAYSCUSTOM("10/08/2010","10/30/2010",3,"10/12/2010") This will count all the work days in between 10/08/2010 and 10/30/2010, taking Monday and Tuesdays as weekend days (3), but exclude the day of 10/12/2010 and will return 17


WeekDay

This function returns a number representing the day of the week.

Syntax

WEEKDAY([Date],[Return Type])

Date is the date to return the weekday from. Date format must be month/date/year.

Return Type is a number representing the day in which the week starts

Return Type

Number returned
1 or Omitted Numbers 1 (Sunday) through 7 (Saturday)
2Numbers 1 (Monday) through 7 (Sunday)
3Numbers 0 (Monday) through 6 (Sunday)
11Numbers 1 (Monday) through 7 (Sunday)
12Numbers 1 (Tuesday) through 7 (Monday)
13Numbers 1 (Wednesday) through 7 (Tuesday)
14Numbers 1 (Thursday) through 7 (Wednesday)
15Numbers 1 (Friday) through 7 (Thursday)
16Numbers 1 (Saturday) through 7 (Friday)
17Numbers 1 (Sunday) through 7 (Saturday)

Examples

Rule

Meaning
WEEKDAY(Today(),2) If this function is called on a Monday it will return 1 as the return type is set to start counting Monday as the first day (2)
WEEKDAY("10/22/2010") This will return 6 as the date given falls on a Friday and the return type omitted which will start counting Sunday as the first day.


WeekNum

This function returns the week of the given date as a number.

Syntax

WEEKNUM([Date],[Return Type])

Date is the date to return the week number from. Date format must be month/date/year.

Return Type is a number representing the day on which the week starts

Return Type

Number returned
1 or Omitted Sunday
2Monday
11Monday
12Tuesday
13Wednesday
14Thursday
15Friday
16Saturday
17Sunday
21Monday

Examples

Rule

Meaning
WEEKNUM(Today()) If this function is called on 10/18/2010 it will return 43 as the week number
WEEKNUM("10/18/2010",12) This will return 42 as the date given falls on a Monday and the week is set to start on a Tuesday (12).


WorkDay

This function returns the date before or after a specified number of work days

Syntax

WORKDAY([Date],[Days],[Holidays])

Date is the date to start counting the number of work days from. Date format must be month/date/year.

Days is the number of work days to include

Holidays are the dates to be ignored. When entering a fixed date the format must be Month Day Year.

Examples

Rule

Meaning
WORKDAY(Today(),10,"10/19/2010")

If this function is called on the 18th October 2010 then it would return the value: "11/02/2010"

Note: The format the date is returned will depend on the system settings of the computer performing the calculation.


WorkDayCustom

This function returns the date before or after a specified number of work days

Syntax

WORKDAYCUSTOM([Date],[Days],[Weekend],[Holidays])

Date is the date to start counting the number of work days from. Date format must be month/date/year.

Days is the number of work days to include

Weekend is a number that represents the weekend days

Holidays are the dates to be ignored. When entering a fixed date the format must be Month Day Year.

Weekend Value

Weekend Days
1 or Omitted Saturday, Sunday
2Sunday, Monday
3Monday, Tuesday
4Tuesday, Wednesday
5Wednesday, Thursday
6Thursday, Friday
7Friday, Saturday
11Sunday only
12Monday only
13Tuesday only
14Wednesday only
15Thursday only
16Friday only
17Saturday only

Examples

Rule

Meaning
WORKDAYCUSTOM(Today(),10,1,"10/27/2010")

If this function is called on the 19th October 2010 then it would return the value: "03/11/2010".

Note: The format the date is returned will depend on the system settings of the computer performing the calculation.


Year

This function returns the year from the given date or date serial number.

Syntax

YEAR([Date])

Date is the date to return the year  from

Examples

Rule

Meaning
YEAR(43563) This will return the year 2019 from the given date serial number
YEAR(Today()) If this function is called on the 19th October 2010 then it would return the value: 2010.


DMax

This function returns the largest value in the given table's column which complies with the specified condition.

Syntax

DMAX([Table or Table Name],[Column Index],[Condition])

Table or Table Name is the table to search in

Column Index is a number representing the index of the column in the table

Condition is the condition to test each cell in the column with

Examples

Rule

Meaning
DMAX(DwLookupDataTable,1,">10") This will look in the table DataTable, in column 1 and return the largest value that is less than 10.


DMin

This function returns the smallest value in the given table's column which complies with the specified condition.

Syntax

DMIN([Table or Table Name],[Column Index],[Condition])

Table or Table Name is the table to search in

Column Index is a number representing the index of the column in the table

Condition is the condition to test each cell in the column with

Examples

Rule

Meaning
DMIN(DwLookupDataTable,1,"<15") This will look in the table DataTable, in column 1 and return the smallest value that is greater than 15.


TextFormat

This function formats one or more values according to the given formatting string.

Syntax

TEXTFORMAT([Format String], [Values])

Format String is the string to format

Values is the value or collection of values (separated with a comma) to be formatted

Examples

Rule

Meaning
TEXTFORMAT("C:\Program Files\{0:0.#}\Hello\World\{1:yyyy-MM-dd hh-mm-ss}",9.7, Now()) Will format the given string to include 9.7 in the first placeholder ({0) and the current date in the second placeholder ({1), formatted as indicated ( :yyyy-MM-dd hh-mm-ss})


FsChangeExtension

This function returns the full file path and name of the given file, substituting it's existing file extension with the given extension.

Syntax

FSCHANGEEXTENSION([Path],[Extension])

Path is the path to the file to change

Extension is the new file extension, or an empty string to remove the file extension

Examples

Rule

Meaning
FsChangeExtension("C:\DriveWorks 8\New Functions\ChangeFileExtension\ MyFileName","xml") This will return the value C:\DriveWorks 8\New Functions\ChangeFileExtension\ MyFileName.xml


FsGetDirectoryName

This function returns the parent directory path from a given file path

Syntax

FSGETDIRECTORYNAME([Path])

Path is the path to return the parent directory from

Examples

Rule

Meaning
FSGETDIRECTORYNAME("C:\DriveWorks 8\Parent Directory\Child Directory") This will return the path C:\DriveWorks 8\Parent Directory


FsGetFileName

This function returns the file name from a file path

Syntax

FSGETFILENAME([Path])

Path is the path to the file to retrieve the file name from

Examples

Rule

Meaning
FSGETFILENAME("C:\DriveWorks 8\Parent Directory\Child Directory\ MyFileName.txt") This will return MyFileName.txt


FsPathCombine

This function combines 2 file paths

Syntax

FSPATHCOMBINE([First Path],[Second Path])

First Path is the first path to combine

Second Path is the second path to combine (must be a relative path)

Examples

Rule

Meaning
FsPathCombine("C:\DriveWorks 8\New Functions","Child Folder") This will return the value C:\DriveWorks 8\New Functions\Child Folder


ListCountItems

This function counts the number of items in a list.

Syntax

LISTCOUNTITEMS([List])

List is the pipe separated list to return the number of items from.

Examples

Rule

Meaning
LISTCOUNTITEMS("A|B|C|D|E|F") This will return 6, as the number of items in the list.
LISTCOUNTITEMS(DWVariableListItems) If the result of the variable ListItems is A|B|C|D|E|F this will return 6


ListFindItem

This function finds the index of an item in a list.

Syntax

LISTFINDITEM([List],[Item])

List is the pipe separated list to find an item in.

Item is the item to find in a list.

Examples

Rule

Meaning
LISTFINDITEM("A|B|C|D|E|F","D") This will return 4 as D is the fourth item in the list


ListGetItem

This function returns the specified item from a list of items

Syntax

LISTGETITEM([List],[Item Index])

List is the pipe separated list to retrieve an item from.

Item is the index of the item to return.

Examples

Rule

Meaning
LISTGETITEM("A|B|C|D|E|F",2) This will return the second (2) item in the list (B)


ListJoin

This function combines two or more values or lists together into a single list

Syntax

LISTJOIN([Values or Lists])

Values or Lists are the values or lists to join into a single list

Examples

Rule

Meaning
LISTJOIN("A|B|C","D|E|F") This will return A|B|C|D|E|F