Article Goal
To provide a complete, categorized reference of all supported functions and operators in VDM, including syntax, examples, and descriptions—organized for ease of use and fast lookup by developers, analysts, and report designers.
What is this?
This article is a centralized knowledge base reference that outlines all the core functions and operators available in VDM's expression engine. It includes:
Date-Time Functions for time-based logic
Logical Functions for Conditional Control
Math Functions for numeric calculations
String Functions for text manipulation
Constants for data comparisons and defaults
Operators for expression construction
Each entry includes a description and a working example, formatted consistently to assist with practical usage in filters, calculated fields, and data transformations.
Why use this?
VDM expressions power much of the logic behind filters, calculated fields, and dashboards. Knowing what functions and operators are available—and how to use them—can:
Save time by avoiding redundant or inefficient logic
Reduce errors by using built-in utilities for common tasks
Improve readability of complex expressions
Empower non-developers with consistent, documented guidance
Enable advanced use cases by chaining functions effectively
Whether you're building a simple report or designing advanced calculations, this reference ensures you're using VDM to its fullest.
How to Use This Guide
Browse by function category for quick lookup
Use the included examples as templates
Copy/paste expressions into VDM queries and tweak as needed
Combine multiple functions (e.g., nesting or chaining) to create dynamic logic
Reference tags to help with search and indexing
Operators
Operators are symbols that perform arithmetic, comparison, logical, and bitwise operations on values or expressions. They form the core of conditional logic and data manipulation in VDM.
Arithmetic Operators
Perform basic mathematical operations such as addition, subtraction, multiplication, division, and modulo. These are commonly used for numeric calculations and derived values in expressions.
| Operator | Description | Example |
|---|---|---|
+ | Adds two numbers or concatenates strings. | [FirstName] + ' ' + [LastName], [UnitPrice] + 4 |
- | Subtracts the second number from the first. | [Price1] - [Price2] |
* | Multiplies two values. | [Quantity] * [UnitPrice] * (1 - [BonusAmount]) |
/ | Divides the first value by the second. | [Quantity] / 2 |
% | Returns the remainder of a division (modulus). | [Quantity] % 3 |
Bitwise and Logical Operators
Operate on the binary representation of integers using logic-based comparisons like AND, OR, and XOR. These are useful for flag manipulation and low-level control logic.
| Operator | Description | Example |
|---|---|---|
| ` | ` | Bitwise OR: if either bit is 1, the result is 1. |
& | Bitwise AND: if both bits are 1, the result is 1. | [Flag] & 10 |
^ | Bitwise XOR: result bit is 1 if only one operand is 1. | [Flag1] ^ [Flag2] |
Comparison Operators
Compare values to determine equality, inequality, or ordering. These operators return Boolean results and are essential for filtering, conditionals, and branching logic.
| Operator | Description | Example |
|---|---|---|
== or = | Returns True If both operands are equal. | [Quantity] == 10, [ID] = 11 |
!= | Returns True if operands are not equal. | [Country] != 'France' |
< | Less than. | [UnitPrice] < 20 |
<= | Less than or equal to. | [UnitPrice] <= 20 |
>= | Greater than or equal to. | [UnitPrice] >= 30 |
> | Greater than. | [UnitPrice] > 30 |
Set, Pattern & Range Operators
Evaluate values against lists, patterns, or ranges. Used for advanced filtering scenarios such as checking inclusion (In), matching patterns (Like), or testing boundaries (Between).
| Operator | Description | Example |
|---|---|---|
In (,,,) | Tests if a value exists within a set. | [Country] In ('USA', 'UK', 'Italy') |
Like | Compares a string against a pattern (wildcards supported). | [Name] Like 'An%' |
Between (,) | Tests if a value falls within a defined range. | [Quantity] Between (10, 20) |
Logical Operators
Control expression flow by combining or negating Boolean values. Often used to build complex conditions in filters, calculated fields, or expression-based rules.
| Operator | Description | Example |
|---|---|---|
And | Logical AND. Both expressions must be true. | [InStock] And ([ExtendedPrice] > 100) |
Or | Logical OR. One or both must be true. | [Country] == 'USA' Or [Country] == 'UK' |
Not or ! | Logical negation (reverses truth value). | Not [InStock] |
Unary Operators
Apply a single-operand transformation such as preserving a value’s sign (+) or negating it (-). Useful for formatting numeric expressions and enforcing polarity.
| Operator | Description | Example |
|---|---|---|
+ | Returns value as-is (unary positive). | +[Value] = 10 |
- | Returns the negative of a value. | -[Value] = 20 |
Null Check Operator
Tests whether a value is NULL, indicating the absence of data. This is critical for safely handling optional fields and preventing errors in expressions.
| Operator | Description | Example |
|---|---|---|
Is Null | Returns True If an expression is NULL. | [Region] Is Null |
Function Groups
Additive Date-Time Functions
These functions return a new date-time value based on adding an interval to an existing date.
| Function | Description | Example |
|---|---|---|
AddDays(DateTime, DaysCount) | Adds days to a date. | AddDays([OrderDate], 30) |
AddHours(DateTime, HoursCount) | Adds hours to a date. | AddHours([StartTime], 2) |
AddMinutes(DateTime, MinutesCount) | Adds minutes to a date. | AddMinutes([StartTime], 30) |
AddSeconds(DateTime, SecondsCount) | Adds seconds to a date. | AddSeconds([StartTime], 60) |
AddMilliSeconds(DateTime, MilliSecondsCount) | Adds milliseconds to a date. | AddMilliSeconds([StartTime], 5000) |
AddTicks(DateTime, TicksCount) | Adds ticks to a date. | AddTicks([StartTime], 5000) |
AddMonths(DateTime, MonthsCount) | Adds months to a date. | AddMonths([OrderDate], 1) |
AddYears(DateTime, YearsCount) | Adds years to a date. | AddYears([EndDate], -1) |
AddTimeSpan(DateTime, TimeSpan) | Adds a TimeSpan object. | AddTimeSpan([StartTime], [Duration]) |
Date Difference Functions
These calculate the interval between two dates.
| Function | Description | Example |
|---|---|---|
DateDiffDay(startDate, endDate) | Difference in full days. | DateDiffDay([startDate], Now()) |
DateDiffHour(startDate, endDate) | Difference in full hours. | DateDiffHour([startDate], Now()) |
DateDiffMinute(startDate, endDate) | Difference in full minutes. | DateDiffMinute([startDate], Now()) |
DateDiffSecond(startDate, endDate) | Difference in full seconds. | DateDiffSecond([startDate], Now()) |
DateDiffMilliSecond(startDate, endDate) | Difference in milliseconds. | DateDiffMilliSecond([startTime], Now()) |
DateDiffTick(startDate, endDate) | Difference in ticks. | DateDiffTick([startDate], Now()) |
DateDiffMonth(startDate, endDate) | Difference in months. | DateDiffMonth([startDate], Now()) |
DateDiffYear(startDate, endDate) | Difference in years. | DateDiffYear([startDate], Now()) |
Extraction Functions
These extract parts of a date-time value.
| Function | Description | Example |
|---|---|---|
GetDate(DateTime) | Extracts the date only. | GetDate([OrderDateTime]) |
GetDay(DateTime) | Extracts the day of the month. | GetDay([OrderDate]) |
GetDayOfWeek(DateTime) | Extracts the day of the week. | GetDayOfWeek([OrderDate]) |
GetDayOfYear(DateTime) | Extracts the day of the year. | GetDayOfYear([OrderDate]) |
GetHour(DateTime) | Extracts an hour. | GetHour([StartTime]) |
GetMinute(DateTime) | Extracts minute. | GetMinute([StartTime]) |
GetSecond(DateTime) | Extracts second. | GetSecond([StartTime]) |
GetMilliSecond(DateTime) | Extracts milliseconds. | GetMilliSecond([StartTime]) |
GetTimeOfDay(DateTime) | Extracts the time portion in ticks. | GetTimeOfDay([StartTime]) |
GetMonth(DateTime) | Extracts the month. | GetMonth([StartTime]) |
GetYear(DateTime) | Extracts the year. | GetYear([StartTime]) |
Relative Date-Time Functions
Return specific anchored moments like "Today", "Next Month", or "This Year".
| Function | Description | Example |
|---|---|---|
Now() | Current system date and time. | AddDays(Now(), 5) |
Today() | Midnight of the current date. | AddMonths(Today(), 1) |
UtcNow() | Current UTC date and time. | AddDays(UtcNow(), 7) |
LocalDateTimeNow() | Current local date-time. | AddDays(LocalDateTimeNow(), 5) |
LocalDateTimeToday() | Local version of Today. | AddDays(LocalDateTimeToday(), 5) |
LocalDateTimeTomorrow() | Tomorrow. | AddDays(LocalDateTimeTomorrow(), 5) |
LocalDateTimeDayAfterTomorrow() | The day after tomorrow. | AddDays(LocalDateTimeDayAfterTomorrow(), 5) |
LocalDateTimeYesterday() | Yesterday. | AddDays(LocalDateTimeYesterday(), 5) |
LocalDateTimeThisWeek() | Start of the current week. | AddDays(LocalDateTimeThisWeek(), 5) |
LocalDateTimeNextWeek() | Start of next week. | AddDays(LocalDateTimeNextWeek(), 5) |
LocalDateTimeLastWeek() | Start of last week. | AddDays(LocalDateTimeLastWeek(), 5) |
LocalDateTimeThisMonth() | Start of the current month. | AddMonths(LocalDateTimeThisMonth(), 5) |
LocalDateTimeNextMonth() | Start of next month. | AddMonths(LocalDateTimeNextMonth(), 5) |
LocalDateTimeLastMonth() | Start of last month. | AddMonths(LocalDateTimeLastMonth(), 5) |
LocalDateTimeThisYear() | Start of the current year. | AddYears(LocalDateTimeThisYear(), 5) |
LocalDateTimeNextYear() | Start of next year. | AddYears(LocalDateTimeNextYear(), 5) |
LocalDateTimeLastYear() | Start of last year. | AddYears(LocalDateTimeLastYear(), 5) |
LocalDateTimeTwoWeeksAway() | Start of two weeks forward. | AddDays(LocalDateTimeTwoWeeksAway(), 5) |
LocalDateTimeTwoMonthsAway() | Start of two months forward. | AddMonths(LocalDateTimeTwoMonthsAway(), 5) |
LocalDateTimeTwoYearsAway() | Start of two years forward. | AddYears(LocalDateTimeTwoYearsAway(), 5) |
LocalDateTimeYearBeforeToday() | Exactly one year ago. | AddYears(LocalDateTimeYearBeforeToday(), 5) |
Logical Date Checks
Return True or False based on whether a date meets a specific condition.
| Function | Description | Example |
|---|---|---|
IsSameDay(DateTime) | Falls on the same day. | IsSameDay([OrderDate]) |
IsThisWeek(DateTime) | Is within the current week. | IsThisWeek([OrderDate]) |
IsThisMonth(DateTime) | Is in the current month. | IsThisMonth([OrderDate]) |
IsThisYear(DateTime) | Is in the current year. | IsThisYear([OrderDate]) |
IsLastMonth(DateTime) | Is in the previous month. | IsLastMonth([OrderDate]) |
IsLastYear(DateTime) | Is in the previous year. | IsLastYear([OrderDate]) |
IsNextMonth(DateTime) | Is in the next month. | IsNextMonth([OrderDate]) |
IsNextYear(DateTime) | Is in the next year. | IsNextYear([OrderDate]) |
IsYearToDate(DateTime) | Is between Jan 1 and now. | IsYearToDate([OrderDate]) |
InDateRange(Date, FromDate, ToDate) | Between two dates (inclusive of start, exclusive of end). | InDateRange([OrderDate], #2022-01-01#, #2022-12-31#) |
Month-Specific Checks
| Function | Description | Example |
|---|---|---|
IsJanuary(DateTime) | Is in January. | IsJanuary([OrderDate]) |
IsFebruary(DateTime) | Is in February. | IsFebruary([OrderDate]) |
IsMarch(DateTime) | Is in March. | IsMarch([OrderDate]) |
IsApril(DateTime) | Is in April. | IsApril([OrderDate]) |
IsMay(DateTime) | Is in May. | IsMay([OrderDate]) |
IsJune(DateTime) | Is in June. | IsJune([OrderDate]) |
IsJuly(DateTime) | Is in July. | IsJuly([OrderDate]) |
IsAugust(DateTime) | Is in August. | IsAugust([OrderDate]) |
IsSeptember(DateTime) | Is in September. | IsSeptember([OrderDate]) |
IsOctober(DateTime) | Is in October. | IsOctober([OrderDate]) |
IsNovember(DateTime) | Is in November. | IsNovember([OrderDate]) |
IsDecember(DateTime) | Is in December. | IsDecember([OrderDate]) |
Logical Functions
These functions allow conditional and null-based logic to be evaluated dynamically within expressions.
| Function | Description | Example |
|---|---|---|
Iif(Expression, TruePart, FalsePart) | Returns TruePart if Expression is true; otherwise returns FalsePart. | Iif([Quantity]>=10, 10, 0) |
IsNull(Value) | Returns True If the value is NULL. | IsNull([OrderDate]) |
IsNull(Value1, Value2) | Returns Value1 if not NULL; otherwise, returns Value2. | IsNull([ShipDate], [RequiredDate]) |
IsNullOrEmpty(String) | Returns True if the string is NULL or empty. | IsNullOrEmpty([ProductName]) |
Math Functions
Mathematical functions used for numeric transformations, rounding, trigonometry, and randomization.
| Function | Description | Example |
|---|---|---|
Abs(Value) | Returns the absolute value. | Abs(1 - [Discount]) |
Acos(Value) | Arccosine of a number in radians. | Acos([Value]) |
Asin(Value) | Arcsine of a number in radians. | Asin([Value]) |
Atn(Value) | Arctangent of a number in radians. | Atn([Value]) |
Atn2(Value1, Value2) | Arctangent of Value1 / Value2. | Atn2([Value1], [Value2]) |
BigMul(Value1, Value2) | Full 64-bit product of two 32-bit integers. | BigMul([Amount], [Quantity]) |
Ceiling(Value) | Rounds up to the nearest whole number. | Ceiling([Value]) |
Cos(Value) | Cosine of angle in radians. | Cos([Value]) |
Cosh(Value) | Hyperbolic cosine. | Cosh([Value]) |
Exp(Value) | Exponential of value (e^x). | Exp([Value]) |
Floor(Value) | Rounds down to the nearest whole number. | Floor([Value]) |
Log(Value) | Natural logarithm. | Log([Value]) |
Log(Value, Base) | Logarithm in base Base. | Log([Value], 2) |
Log10(Value) | Base 10 logarithm. | Log10([Value]) |
Power(Value, Power) | Raises a value to a power. | Power([Value], 3) |
Rnd() | Random number between 0 and 1. | Rnd()*100 |
Round(Value) | Rounds to the |nearestinteger. | Round([Value]) |
Sign(Value) | Returns +1, 0, or -1. | Sign([Value]) |
Sin(Value) | Sine of angle in radians. | Sin([Value]) |
Sinh(Value) | Hyperbolic sine. | Sinh([Value]) |
Sqr(Value) | Square root. | Sqr([Value]) |
Tan(Value) | Tangent of angle in radians. | Tan([Value]) |
Tanh(Value) | Hyperbolic tangent. | Tanh([Value]) |
String Functions
Manipulate, format, and evaluate string values using these powerful tools.
| Function | Description | Example |
|---|---|---|
Ascii(String) | ASCII value of the first character. | Ascii('a') |
Char(Number) | Character for the ASCII code. | Char(65) + Char(51) |
CharIndex(String1, String2) | Position of String1 in String2. | CharIndex('e', 'devexpress') |
CharIndex(String1, String2, StartLocation) | Same as above, starting at StartLocation. | CharIndex('e', 'devexpress', 2) |
Concat(String1, ..., StringN) | Concatenates multiple strings. | Concat('A', ')', [ProductName]) |
Insert(String1, StartPosition, String2) | Inserts String2 into String1. | Insert([Name], 0, 'ABC-') |
Len(Value) | Length of string or byte size. | Len([Description]) |
Lower(String) | Converts to lowercase. | Lower([ProductName]) |
PadLeft(String, Length) | Pads on the left with spaces. | Example not provided |
PadLeft(String, Length, Char) | Pads on the left with Char. | PadLeft([Name], 30, '<') |
PadRight(String, Length) | Pads on the right with spaces. | PadRight([Name], 30) |
PadRight(String, Length, Char) | Pads on the right with Char. | PadRight([Name], 30, '>') |
Remove(String, StartPosition, Length) | Deletes characters from a string. | Remove([Name], 0, 3) |
Replace(String, SubString2, String3) | Replaces SubString2 with String3. | Replace([Name], 'The ', '') |
Reverse(String) | Reverses the string. | Reverse([Name]) |
Substring(String, StartPosition, Length) | Gets a substring of fixed length. | Substring([Description], 2, 3) |
Substring(String, StartPosition) | Gets a substring from position. | Substring([Description], 2) |
ToStr(Value) | Converts to a string. | ToStr([ID]) |
Trim(String) | Removes whitespace from both ends. | Trim([ProductName]) |
Upper(String) | Converts to uppercase. | Upper([ProductName]) |
Constants
Constants are static values used in expressions for comparison, evaluation, and default assignments.
| Constant Type | Description | Example |
|---|---|---|
String constants | Must be wrapped in apostrophes. | [Country] == 'France' |
String with apostrophe | Double the apostrophe character. | [Name] == 'O''Neil' |
Date-time constants | Must be wrapped in #. | [OrderDate] >= #1/1/2009# |
True | Boolean true. | [InStock] == True |
False | Boolean false. | [InStock] == False |
? | Represents NULL or DBNull.Value. | [Region] != ? |
Final Notes
Each of these functions is usable within VDM’s expression builder or query logic to streamline operations, enhance conditional logic, or dynamically derive new fields. Combine across categories (e.g., Iif(DateDiffDay(...) > 30, ...)) for powerful transformations.
Comments
0 comments
Please sign in to leave a comment.