Please enable JavaScript to view this site.

thankQ Help

Date-time Functions

Function

Description

Example

AddDays(DateTime, DaysCount)

Returns a date-time value that is the specified number of days away from the specified DateTime.

AddDays([OrderDate], 30)

AddHours(DateTime, HoursCount)

Returns a date-time value that is the specified number of hours away from the specified DateTime.

AddHours([StartTime], 2)

AddMilliSeconds(DateTime, MilliSecondsCount)

Returns a date-time value that is the specified number of milliseconds away from the specified DateTime.

AddMilliSeconds(([StartTime], 5000))

AddMinutes(DateTime, MinutesCount)

Returns a date-time value that is the specified number of minutes away from the specified DateTime.

AddMinutes([StartTime], 30)

AddMonths(DateTime, MonthsCount)

Returns a date-time value that is the specified number of months away from the specified DateTime.

AddMonths([OrderDate], 1)

AddSeconds(DateTime, SecondsCount)

Returns a date-time value that is the specified number of seconds away from the specified DateTime.

AddSeconds([StartTime], 60)

AddTicks(DateTime, TicksCount)

Returns a date-time value that is the specified number of ticks away from the specified DateTime.

AddTicks([StartTime], 5000)

AddTimeSpan(DateTime, TimeSpan)

Returns a date-time value that is away from the specified DateTime for the given TimeSpan.

AddTimeSpan([StartTime], [Duration])

AddYears(DateTime, YearsCount)

Returns a date-time value that is the specified number of years away from the specified DateTime.

AddYears([EndDate], -1)

AddYears(DateTime, YearsCount)

Returns a date-time value that is the specified number of years away from the specified DateTime.

AddYears([EndDate], -1)

DateDiffDay(DateTime, DateTime)

Counts the number of day boundaries between two dates.

DateDiffDay([DateStart], [DateEnd])

DateDiffHour(DateTime, DateTime)

Counts the number of hour boundaries between two dates.

DateDiffHour([TimeStart], [TimeEnd])

DateDiffMillisecond(DateTime, DateTime)

Counts the number of millisecond boundaries between two dates.

Millisecond([TimeStart], [TimeEnd])

DateDiffMinute(DateTime, DateTime)

Counts the number of minute boundaries between two dates.

DateDiffMinute([TimeStart], [TimeEnd])

DateDiffMonth(DateTime, DateTime)

Counts the number of month boundaries between two dates.

DateDiffMonth([TimeStart], [TimeEnd])

DateDiffSecond(DateTime, DateTime)

Counts the number of second boundaries between two dates.

DateDiffSecond([TimeStart], [TimeEnd])

DateDiffTick(DateTime, DateTime)

Counts the number of tick boundaries between two dates.

DateDiffTick([TimeStart], [TimeEnd])

DateDiffYear(DateTime, DateTime)

Counts the number of year boundaries between two dates.

DateDiffYear([TimeStart], [TimeEnd])

GetDate(DateTime)

Extracts a date from the defined DateTime.

GetDate([OrderDate])

GetDay(DateTime)

Extracts a day from the defined DateTime.

GetDay([OrderDate])

GetDayOfWeek(DateTime)

Extracts a day of the week from the defined DateTime.

GetDayOfWeek([OrderDate])

GetDayOfYear(DateTime)

Extracts a day of the year from the defined DateTime.

GetDayOfYear([OrderDate])

GetHour(DateTime)

Extracts an hour from the defined DateTime.

GetHour([StartTime])

GetMilliSecond(DateTime)

Extracts milliseconds from the defined DateTime.

GetMilliSecond([StartTime])

GetMinute(DateTime)

Extracts minutes from the defined DateTime.

GetMinute([StartTime])

GetMonth(DateTime)

Extracts a month from the defined DateTime.

GetMonth([StartTime])

GetSecond(DateTime)

Extracts seconds from the defined DateTime.

GetSecond([StartTime])

GetTimeOfDay(DateTime)

Extracts the time of the day from the defined DateTime, in ticks.

GetTimeOfDay([StartTime])

GetYear(DateTime)

Extracts a year from the defined DateTime.

GetYear([StartTime])

IsApril(DateTime)

Returns True if the specified date falls within April.

IsApril([OrderDate])

IsAugust(DateTime)

Returns True if the specified date falls within August.

IsAugust([OrderDate])

IsDecember(DateTime)

Returns True if the specified date falls within December.

IsDecember([OrderDate])

IsFebruary(DateTime)

Returns True if the specified date falls within February.

IsFebruary([OrderDate])

IsJanuary(DateTime)

Returns True if the specified date falls within January.

IsJanuary([OrderDate])

IsJuly(DateTime)

Returns True if the specified date falls within July.

IsJuly([OrderDate])

IsJune(DateTime)

Returns True if the specified date falls within June.

IsJune([OrderDate])

IsLastMonth(DateTime)

Returns True if the specified date falls within the previous month.

IsLastMonth([OrderDate])

IsLastYear(DateTime)

Returns True if the specified date falls within the previous year.

IsLastYear([OrderDate])

IsMarch(DateTime)

Returns True if the specified date falls within March.

IsMarch([OrderDate])

IsMay(DateTime)

Returns True if the specified date falls within May.

IsMay([OrderDate])

IsNextMonth(DateTime)

Returns True if the specified date falls within the next month.

IsNextMonth([OrderDate])

IsNextYear(DateTime)

Returns True if the specified date falls within the next year.

IsNextYear([OrderDate])

IsNovember(DateTime)

Returns True if the specified date falls within November.

IsNovember([OrderDate])

IsOctober(DateTime)

Returns True if the specified date falls within October.

IsOctober([OrderDate])

IsSameDay(DateTime, DateTime)

Returns True if the specified date-time values fall within the same day.

IsSameDay([StartDate],[EndDate])

IsSeptember(DateTime)

Returns True if the specified date falls within September.

IsSeptember([OrderDate])

IsThisMonth(DateTime)

Returns True if the specified date falls within the current month.

IsThisMonth([OrderDate])

IsThisWeek(DateTime)

Returns True if the specified date falls within the current week.

IsThisWeek([OrderDate])

IsThisYear(DateTime)

Returns True if the specified date falls within the current year.

IsThisYear([OrderDate])

IsYearToDate(DateTime)

Returns True if the specified date falls within the year-to-date period (starting from the first day of the current year and continuing up to the current date).

IsYearToDate([OrderDate])

LocalDateTimeDayAfterTomorrow()

Returns a date-time value corresponding to the day after Tomorrow.

IsThisWeek(LocalDateTimeDayAfterTomorrow())

LocalDateTimeLastMonth()

Returns a date-time value corresponding to the first day of the previous month.

IsThisYear(LocalDateTimeLastMonth())

LocalDateTimeLastWeek()

Returns a date-time value corresponding to the first day of the previous week.

IsThisMonth(LocalDateTimeLastWeek())

LocalDateTimeLastYear()

Returns a date-time value corresponding to the first day of the previous year.

GetDayOfWeek(LocalDateTimeLastYear())

LocalDateTimeNextMonth()

Returns a date-time value corresponding to the first day of next month.

GetDayOfWeek(LocalDateTimeNextMonth())

LocalDateTimeNextWeek()

Returns a date-time value corresponding to the first day of the following week.

GetDayOfYear(LocalDateTimeNextWeek())

LocalDateTimeNextYear()

Returns a date-time value corresponding to the first day of the following year.

GetDayOfWeek(LocalDateTimeNextYear())

LocalDateTimeNow()

Returns a date-time value corresponding to the current moment in time.

IsSeptember(LocalDateTimeNow())

LocalDateTimeThisMonth()

Returns a date-time value corresponding to the first day of the current month.

IsOctober(LocalDateTimeThisMonth())

LocalDateTimeThisWeek()

Returns a date-time value corresponding to the first day of the current week.

IsThisMonth(LocalDateTimeThisWeek())

LocalDateTimeThisYear()

Returns a date-time value corresponding to the first day of the current year.

GetDayOfWeek(LocalDateTimeThisYear())

LocalDateTimeToday()

Returns a date-time value corresponding to Today.

IsNovember(LocalDateTimeToday())

LocalDateTimeTomorrow()

Returns a date-time value corresponding to Tomorrow.

IsThisWeek(LocalDateTimeTomorrow())

LocalDateTimeTwoMonthsAway()

Returns a date-time value corresponding to the first day of the month after next.

IsThisYear(LocalDateTimeTwoMonthsAway())

LocalDateTimeTwoWeeksAway()

Returns a date-time value corresponding to the first day of the week that is after next week.

IsThisMonth(LocalDateTimeTwoWeeksAway())

LocalDateTimeTwoYearsAway()

Returns a date-time value corresponding to the first day of the year after next.

GetDayOfWeek(LocalDateTimeTwoYearsAway())

LocalDateTimeYearBeforeToday()

Returns a date-time value corresponding to the day one year ago.

GetDayOfWeek(LocalDateTimeYearBeforeToday())

LocalDateTimeYesterday()

Returns a date-time value corresponding to Yesterday.

IsThisWeek(LocalDateTimeYesterday())

Now()

Returns the current system date and time.

AddDays(Now(), 5)

Today()

Returns the current date. Regardless of the actual time, this function returns midnight of the current date.

AddMonths(Today(), 1)

UtcNow()

Returns the current system date and time that is expressed as Coordinated Universal Time (UTC).

AddDays(UtcNow(), 7)

Logical Functions

Function

Description

Example

Iif(Expression, TruePart, FalsePart)

Returns either TruePart or FalsePart, depending on the evaluation of the Boolean Expression.

Iif([Quantity>=10], 10, 0 )

IsNull(Value)

Returns True if the specified Value is NULL.

IsNull([OrderDate])

IsNullOrEmpty(String)

Returns True if the specified String object is NULL or an empty string; otherwise, False is returned.

IsNullOrEmpty([ProductName])

Math Functions

Function

Description

Example

Abs(Value)

Returns the absolute positive value of the given numeric expression.

Abs(1 - [Discount])

Acos(Value)

Returns the arccosine of a number (the angle, in radians, whose cosine is the given float expression).

Acos([Value])

Asin(Value)

Returns the arcsine of a number (the angle, in radians, whose sine is the given float expression).

Asin([Value])

Atn(Value)

Returns the arctangent of a number (the angle, in radians, whose tangent is the given float expression).

Atn([Value])

Atn2(Value1, Value2)

Returns the angle, whose tangent is the quotient of two specified numbers, in radians.

Atn2([Value1], [Value2])

BigMul(Value1, Value2)

Returns an Int64 containing the full product of two specified 32-bit numbers.

BigMul([Amount], [Quantity])

Ceiling(Value)

Returns the smallest integer that is greater than or equal to the given numeric expression.

Ceiling([Value])

Cos(Value)

Returns the cosine of the angle defined in radians.

Cos([Value])

Cosh(Value)

Returns the hyperbolic cosine of the angle defined in radians.

Cosh([Value])

Exp(Value)

Returns the exponential value of the given float expression.

Exp([Value])

Floor(Value)

Returns the largest integer less than or equal to the given numeric expression.

Floor([Value])

Log(Value)

Returns the natural logarithm of a specified number.

Log([Value])

Log(Value, Base)

Returns the logarithm of a specified number in a specified Base.

Log([Value], 2)

Log10(Value)

Returns the base 10 logarithm of a specified number.

Log10([Value])

Max(Value1, Value2)

Returns the maximum value from the specified values.

Max([Value1],[Value2])

Min(Value1, Value2)

Returns the minimum value from the specified values.

Min([Value1],[Value2])

Power(Value, Power)

Returns a specified number raised to a specified power.

Power([Value], 3)

Rnd()

Returns a random number that is less than 1, but greater than or equal to zero.

Rnd()*100

Round(Value)

Rounds the given value to the nearest integer.

Round([Value])

Round(Value, Precision)

Rounds the given value to the nearest integer, or to a specified number of decimal places.

Round([Value, 2])

Sign(Value)

Returns the positive (+1), zero (0), or negative (-1) sign of the given expression.

Sign([Value])

Sin(Value)

Returns the sine of the angle, defined in radians.

Sin([Value])

Sinh(Value)

Returns the hyperbolic sine of the angle defined in radians.

Sinh([Value])

Sqr(Value)

Returns the square root of a given number.

Sqr([Value])

Tan(Value)

Returns the tangent of the angle defined in radians.

Tan([Value])

Tanh(Value)

Returns the hyperbolic tangent of the angle defined in radians.

Tanh([Value])

ToDecimal(Value)

Converts Value to an equivalent decimal number.

ToDecimal([Value])

ToDouble(Value)

Converts Value to an equivalent 64-bit double-precision floating-point number.

ToDecimal([Value])

ToFloat(Value)

Converts Value to an equivalent 32-bit single-precision floating-point number.

ToFloat([Value])

ToInt(Value)

Converts Value to an equivalent 32-bit signed integer.

ToInt([Value])

ToLong(Value)

Converts Value to an equivalent 64-bit signed integer.

ToLong([Value])

String Functions

Function

Description

Example

Ascii(String)

Returns the ASCII code value of the leftmost character in a character expression.

Ascii('a')

Char(Number)

Converts integerASCIICode to a character.

Char(65) + Char(51)

CharIndex(String1, String2)

Returns the starting position of String1 within String2, beginning from the zero character position to the end of a string.

CharIndex('e', 'devexpress')

CharIndex(String1, String2, StartLocation)

Returns the starting position of String1 within String2, beginning from the StartLocation character position to the end of a string.

CharIndex('e', 'devexpress', 2)

Concat(String1, ... , StringN)

Returns a string value containing the concatenation of the current string with any additional strings.

Concat('A', ')', [ProductName])

Contains(String, SubString)

Returns True if SubString occurs within String; otherwise, False is returned.

Contains([Description], 'devexpress')

EndsWith(String, EndString)

Returns True if the end of String matches EndString; otherwise, False is returned.

EndsWith([Description], 'press')

Insert(String1, StartPosition, String2)

Inserts String2 into String1 at the position specified by StartPositon

Insert([Name], 0, 'ABC-')

Len(Value)

Returns an integer containing either the number of characters in a string or the nominal number of bytes required to store a variable.

Len([Description])

Lower(String)

Returns the String in lowercase.

Lower([ProductName])

PadLeft(String, Length)

Left-aligns characters in the defined string, padding its left side with white space characters up to a specified total length.

PadLeft([Name], 30)

PadLeft(String, Length, Char)

Left-aligns characters in the defined string, padding its left side with the specified Char up to a specified total length.

PadLeft([Name], 30, '<')

PadRight(String, Length)

Right-aligns characters in the defined string, padding its left side with white space characters up to a specified total length.

PadRight([Name], 30)

PadRight(String, Length, Char)

Right-aligns characters in the defined string, padding its left side with the specified Char up to a specified total length.

PadRight([Name], 30, '>')

Remove(String, StartPosition)

Deletes all characters from this instance, beginning at a specified position.

Remove([Name], 4)

Remove(String, StartPosition, Length)

Deletes a specified number of characters from this instance, beginning at a specified position.

Remove([Name], 0, 3)

Replace(String, SubString2, String3)

Returns a copy of String1, in which SubString2 has been replaced with String3.

Replace([Name], 'The ', ''

Reverse(String)

Reverses the order of elements within a string.

Reverse([Name])

StartsWith(String, StartString)

Returns True if the beginning of String matches StartString; otherwise, False is returned.

StartsWith([Name], 'be')

Substring(String, StartPosition, Length)

Retrieves a substring from String. The substring starts at StartPosition and has the specified Length..

Substring([Description], 2, 3)

Substring(String, StartPosition)

Retrieves a substring from String. The substring starts at StartPosition.

Substring([Description], 2)

ToStr(Value)

Returns a string representation of an object.

ToStr([ID])

Trim(String)

Removes all leading and trailing SPACE characters from String.

Trim([ProductName])

Upper(String)

Returns String in uppercase.

Upper([ProductName])