Package net.ucanaccess.converters
Class Functions
java.lang.Object
net.ucanaccess.converters.Functions
-
Method Summary
Modifier and TypeMethodDescriptionstatic IntegerReturns an Integer representing the character code corresponding to the first letter in a string.static doubleatn(double _number) Returns a double specifying the arctangent of a number.static booleanConverts a value to a boolean.static booleanstatic booleancbool(BigDecimal _value) static BigDecimalccur(BigDecimal _value) Converts an expression into a currency value.static TimestampConverts an expression into a date value.static DoubleConverts an expression to a double.static Doublestatic Shortcint(boolean _boolean) static Shortstatic IntegerConverts an expression to a long integer.static Integerstatic Integerstatic Integerclong(boolean _value) static Integerstatic Integerstatic Booleanstatic doublecsign(double _value) static Stringcstr(double _value) static Stringcstr(int _value) static StringConverts a value to a string.static Stringstatic Stringstatic Stringstatic Timestampdate()Returns the current system date.static Timestampstatic Timestampstatic DateReturns a date containing a date to which a specified time interval has been added.static Integerstatic Integerstatic Integerstatic Integerstatic Integerstatic Integerstatic Integerstatic Integerstatic IntegerReturns an integer containing the specified part of a given date.static Integerstatic TimestampdateSerial(int _year, int _month, int _day) Returns a date for a specified year, month, and day.static Timestampstatic TimestampReturns a date based on a string.static doubleddb(double cost, double salvage, double life, double period) static doubleddb(double cost, double salvage, double life, double period, double factor) static Booleanstatic BooleanequalsIgnoreOrder(Object _obj1, Object _obj2) static DoubleReturns the integer portion of a number.static Stringstatic Stringstatic Stringstatic Stringstatic BooleanformulaToBoolean(Boolean res, String datatype) static BooleanformulaToBoolean(Double res, String datatype) static BooleanformulaToBoolean(String res, String datatype) static BooleanformulaToBoolean(Timestamp res, String datatype) static TimestampformulaToDate(Boolean res, String datatype) static TimestampformulaToDate(Double res, String datatype) static TimestampformulaToDate(String res, String datatype) static TimestampformulaToDate(Timestamp res, String datatype) static DoubleformulaToNumeric(Boolean res, String datatype) static DoubleformulaToNumeric(Double res, String datatype) static DoubleformulaToNumeric(String _res, String _datatype) static DoubleformulaToNumeric(Timestamp res, String datatype) static StringformulaToText(Boolean res, String datatype) static StringformulaToText(Double res, String datatype) static StringformulaToText(String res, String datatype) static StringformulaToText(Timestamp res, String datatype) static doublefv(double rate, int periods, double payment) static doublefv(double rate, int periods, double payment, double pv) static doublefv(double rate, int periods, double payment, double pv, double type) static Booleanstatic Doublestatic Integerstatic StringReturns one of two parts, depending on the evaluation of an expression.static Timestampstatic IntegerReturns the position of the first occurrence of a string in another string.static Integerstatic Integerstatic Integerstatic IntegerReturns the position of the first occurrence of a string in another string, starting from the end of the string.static Integerstatic Integerstatic doubleipmt(double rate, double per, double nper, double pv) static doubleipmt(double rate, double per, double nper, double pv, double fv) static doubleipmt(double rate, double per, double nper, double pv, double fv, double type) static booleanReturnstrueif the expression is a valid date, otherwisefalse.static booleanstatic booleanstatic booleanReturnstrueif the expression is anullvalue, otherwisefalse.static booleanstatic booleanstatic booleanReturnstrueif the expression is a valid number, otherwisefalse.static StringExtracts a substring from a string, starting from the left-most character.static Stringstatic IntegerReturns the length of the specified string.static StringExtracts a substring from a string (starting at any position).static Stringstatic Shortmint(boolean _value) static IntegerReturns the integer portion of a number.static StringmonthName(int _number) Returns a string representing the month given a number from 1 to 12.static StringmonthName(int _number, boolean _abbreviate) static Timestampnow()Returns the current system date and time.static doublenper(double rate, double pmt, double pv) static doublenper(double rate, double pmt, double pv, double fv) static doublenper(double rate, double pmt, double pv, double fv, double type) static Doublestatic Doublestatic Integerstatic Integerstatic StringReturns the second argument if the first argument isnull.static Stringstatic BigDecimalnz(BigDecimal _value) static BigDecimalnz(BigDecimal value, BigDecimal _other) static Stringstatic Stringstatic doublepmt(double rate, double periods, double pv) static doublepmt(double rate, double periods, double pv, double fv) static doublepmt(double rate, double periods, double pv, double fv, double type) static doubleppmt(double rate, int per, int nper, double pv) static doubleppmt(double rate, int per, int nper, double pv, double fv) static doubleppmt(double rate, int per, int nper, double pv, double fv, double type) static doublepv(double rate, double nper, double pmt) static doublepv(double rate, double nper, double pmt, double fv) static doublepv(double rate, double nper, double pmt, double fv, double type) static doublerate(double nper, double pmt, double pv) static doublerate(double nper, double pmt, double pv, double fv) static doublerate(double nper, double pmt, double pv, double fv, double type) static doublerate(double nper, double pmt, double pv, double fv, double type, double guess) static StringExtracts a substring from a string starting from the right-most character.static Stringstatic Doublernd()Generates a random number (integer value).static Doublestatic doubleround(double d, double p) Returns a number rounded to a specified number of decimal places.static shortsgn(double _n) Returns the sign of a number.static shortsign(double _n) static doublesln(double cost, double salvage, double life) static StringReturns a string with a specified number of spaces.static doublesqr(double _number) Returns a double specifying the square root of a number.static Stringstr(double d) Returns a string representation of a number.static Integerstatic IntegerReturns an integer value representing the result of a string comparison.static StringReturns a string converted as specified.static StringReturns a Variant (String) containing a repeating character string of the length specified.static StringstrReverse(String _value) Returns a string whose characters are in reverse order.static doublesyd(double cost, double salvage, double life, double per) static Timestamptime()Returns the current system time.static TimestamptimeSerial(Integer _h, Integer _m, Integer _s) Returns a time given an hour, minute, and second value.static Timestamptimestamp0(String _dt) static DoubleAccepts a string as input and returns the numbers found in that string.static Doubleval(BigDecimal _val1) static IntegerReturns a number representing the day of the week (a number from 1 to 7) given a date value.static Integerstatic StringweekdayName(int _number) Returns a string representing the day of the week given a number from 1 to 7.static StringweekdayName(int _number, boolean _abbreviate) static StringweekdayName(int _number, boolean _abbreviate, int _firstDayOfWeek)
-
Method Details
-
asc
Returns an Integer representing the character code corresponding to the first letter in a string.- Parameters:
_s- any valid string expression- Returns:
- character code
-
equals
-
equalsIgnoreOrder
-
contains
-
atn
public static double atn(double _number) Returns a double specifying the arctangent of a number.- Parameters:
_number- a double or any valid numeric expression.- Returns:
- arctangent
-
sqr
public static double sqr(double _number) Returns a double specifying the square root of a number.- Parameters:
_number- a double greater than or equal to zero- Returns:
- square root
-
cbool
-
cbool
Converts a value to a boolean.- Parameters:
_value- boolean input- Returns:
- boolean
-
cbool
-
ccur
Converts an expression into a currency value. -
cdate
Converts an expression into a date value. -
cdbl
Converts an expression to a double. -
cdec
-
cint
-
cint
-
clng
Converts an expression to a long integer. -
clng
- Throws:
UcanaccessSQLException
-
clng
-
clong
-
clong
-
clong
-
csign
public static double csign(double _value) -
cstr
Converts a value to a string.- Throws:
UcanaccessSQLException
-
cstr
-
cstr
- Throws:
UcanaccessSQLException
-
cstr
- Throws:
UcanaccessSQLException
-
cstr
- Throws:
UcanaccessSQLException
-
cvar
- Throws:
UcanaccessSQLException
-
dateAdd
Returns a date containing a date to which a specified time interval has been added.- Parameters:
_intv- interval of time_vl- number of intervals to add (to get dates in the future) or dedcut (to get dates in the past)_dt- date to which the interval is added- Returns:
- calculated date
- Throws:
UcanaccessSQLException- on invalid date interval input
-
dateAdd
- Throws:
UcanaccessSQLException
-
dateAdd
- Throws:
UcanaccessSQLException
-
dateDiff
public static Integer dateDiff(String _intv, String _dt1, String _dt2) throws UcanaccessSQLException - Throws:
UcanaccessSQLException
-
dateDiff
public static Integer dateDiff(String _intv, String _dt1, Timestamp _dt2) throws UcanaccessSQLException - Throws:
UcanaccessSQLException
-
dateDiff
public static Integer dateDiff(String _intv, Timestamp _dt1, String _dt2) throws UcanaccessSQLException - Throws:
UcanaccessSQLException
-
dateDiff
public static Integer dateDiff(String _intv, Timestamp _dt1, Timestamp _dt2) throws UcanaccessSQLException - Throws:
UcanaccessSQLException
-
datePart
public static Integer datePart(String _intv, String _dt, Integer _firstDayOfWeek) throws UcanaccessSQLException - Throws:
UcanaccessSQLException
-
datePart
public static Integer datePart(String _interval, Timestamp _date, Integer _firstDayOfWeek) throws UcanaccessSQLException Returns an integer containing the specified part of a given date.- Parameters:
_interval- interval of time you want to return_date- value that you want to evaluate_firstDayOfWeek- constant that specifies the first day of the week- Returns:
- date part
- Throws:
UcanaccessSQLException- on invalid date interval input
-
datePart
public static Integer datePart(String _intv, String _dt, Integer _firstDayOfWeek, Integer _firstWeekOfYear) throws UcanaccessSQLException - Throws:
UcanaccessSQLException
-
datePart
public static Integer datePart(String _intv, Timestamp _dt, Integer _firstDayOfWeek, Integer _firstWeekOfYear) throws UcanaccessSQLException - Throws:
UcanaccessSQLException
-
datePart
- Throws:
UcanaccessSQLException
-
datePart
- Throws:
UcanaccessSQLException
-
dateSerial
Returns a date for a specified year, month, and day.- Parameters:
_year- number between 100 and 9999, inclusive, or a numeric expression_month- any numeric expression_day- any numeric expression- Returns:
- date
-
dateValue
-
timestamp0
-
dateValue
Returns a date based on a string. If the given string does not include a year component, this function will use the current year. -
format
- Throws:
UcanaccessSQLException
-
format
- Throws:
UcanaccessSQLException
-
format
- Throws:
UcanaccessSQLException
-
format
- Throws:
UcanaccessSQLException
-
iif
Returns one of two parts, depending on the evaluation of an expression. -
iif
-
iif
-
iif
-
iif
-
instr
Returns the position of the first occurrence of a string in another string. -
instr
-
instr
-
instr
-
instrrev
Returns the position of the first occurrence of a string in another string, starting from the end of the string. -
instrrev
-
instrrev
-
isDate
Returnstrueif the expression is a valid date, otherwisefalse. -
isDate
-
isNull
Returnstrueif the expression is anullvalue, otherwisefalse. -
isNull
-
isNull
-
isNumeric
Returnstrueif the expression is a valid number, otherwisefalse. -
isNumeric
-
left
Extracts a substring from a string, starting from the left-most character. -
leftS
-
len
Returns the length of the specified string. -
mid
Extracts a substring from a string (starting at any position). -
mid
-
monthName
Returns a string representing the month given a number from 1 to 12.- Throws:
UcanaccessSQLException
-
monthName
- Throws:
UcanaccessSQLException
-
date
Returns the current system date. -
now
Returns the current system date and time. -
nz
Returns the second argument if the first argument isnull. -
nz
-
nz
-
nz
-
nz
-
nz
-
nz
-
nz
-
sgn
public static short sgn(double _n) Returns the sign of a number. If number > 0, it returns 1. If number = 0, it returns 0. -
sign
public static short sign(double _n) -
space
Returns a string with a specified number of spaces. -
str
Returns a string representation of a number. -
time
Returns the current system time. -
val
Accepts a string as input and returns the numbers found in that string. -
val
-
weekdayName
Returns a string representing the day of the week given a number from 1 to 7. -
weekdayName
-
weekdayName
-
weekDay
Returns a number representing the day of the week (a number from 1 to 7) given a date value.- Throws:
UcanaccessSQLException
-
weekDay
public static Integer weekDay(Timestamp _date, Integer _firstDayOfWeek) throws UcanaccessSQLException - Throws:
UcanaccessSQLException
-
string
Returns a Variant (String) containing a repeating character string of the length specified. -
timeSerial
Returns a time given an hour, minute, and second value. -
rnd
Generates a random number (integer value). -
rnd
-
strReverse
Returns a string whose characters are in reverse order. -
strConv
Returns a string converted as specified. -
strComp
public static Integer strComp(String _value1, String _value2, Integer _type) throws UcanaccessSQLException Returns an integer value representing the result of a string comparison.- Throws:
UcanaccessSQLException
-
strComp
- Throws:
UcanaccessSQLException
-
mint
Returns the integer portion of a number. -
mint
-
ddb
public static double ddb(double cost, double salvage, double life, double period) -
ddb
public static double ddb(double cost, double salvage, double life, double period, double factor) -
fv
public static double fv(double rate, int periods, double payment) -
fv
public static double fv(double rate, int periods, double payment, double pv) -
fv
public static double fv(double rate, int periods, double payment, double pv, double type) -
pmt
public static double pmt(double rate, double periods, double pv) -
pmt
public static double pmt(double rate, double periods, double pv, double fv) -
pmt
public static double pmt(double rate, double periods, double pv, double fv, double type) -
nper
public static double nper(double rate, double pmt, double pv) -
nper
public static double nper(double rate, double pmt, double pv, double fv) -
nper
public static double nper(double rate, double pmt, double pv, double fv, double type) -
ipmt
public static double ipmt(double rate, double per, double nper, double pv) -
ipmt
public static double ipmt(double rate, double per, double nper, double pv, double fv) -
ipmt
public static double ipmt(double rate, double per, double nper, double pv, double fv, double type) -
pv
public static double pv(double rate, double nper, double pmt) -
pv
public static double pv(double rate, double nper, double pmt, double fv) -
pv
public static double pv(double rate, double nper, double pmt, double fv, double type) -
ppmt
public static double ppmt(double rate, int per, int nper, double pv) -
ppmt
public static double ppmt(double rate, int per, int nper, double pv, double fv) -
ppmt
public static double ppmt(double rate, int per, int nper, double pv, double fv, double type) -
sln
public static double sln(double cost, double salvage, double life) -
syd
public static double syd(double cost, double salvage, double life, double per) -
rate
public static double rate(double nper, double pmt, double pv) -
rate
public static double rate(double nper, double pmt, double pv, double fv) -
rate
public static double rate(double nper, double pmt, double pv, double fv, double type) -
rate
public static double rate(double nper, double pmt, double pv, double fv, double type, double guess) -
formulaToNumeric
-
formulaToNumeric
-
formulaToNumeric
-
formulaToNumeric
- Throws:
UcanaccessSQLException
-
formulaToBoolean
-
formulaToBoolean
-
formulaToBoolean
-
formulaToBoolean
-
formulaToText
-
formulaToText
-
formulaToText
-
formulaToText
- Throws:
UcanaccessSQLException
-
formulaToDate
-
formulaToDate
-
formulaToDate
- Throws:
UcanaccessSQLException
-
orderJet
-
formulaToDate
- Throws:
UcanaccessSQLException
-
right
Extracts a substring from a string starting from the right-most character. -
rightS
-
round
public static double round(double d, double p) Returns a number rounded to a specified number of decimal places. -
fix
Returns the integer portion of a number.- Parameters:
_number- a double or any valid numeric expression, ifnull,nullis returned- Returns:
- integer portion
-
partition
-