Data Type Conversion Functions You use the CDBL function to convert a string or expression into a value of data type Double.. You use the CINT function to convert a string or expression
Trang 1The dimension of the array to examine (default is 1)
The return value is of the Integer data type
You use the UBOUND function to return the highest subscript defined for the specified dimension of an array
UBOUND ( array [, dimension] )
array The name of the array to examine
dimension
The dimension of the array to examine (default is 1)
The return value is of the Integer data type
Data Type Conversion Functions
You use the CDBL function to convert a string or expression into a value of data type Double
CDBL ( expression )
expression
Can be any valid Oracle Basic variable or expression
The return value is of the Double data type
You use the CINT function to convert a string or expression into a value of data type Integer
CINT ( expression )
expression
Can be any valid Oracle Basic variable or expression
The return value is of the Integer data type
You use the CLNG function to convert a string or expression into a value of data type Long
CLNG ( expression )
Trang 2Can be any valid Oracle Basic variable or expression
The return value is of the Long data type
You use the CSNG function to convert a string or expression into a value of data type Single
CSNG ( expression )
expression
Can be any valid Oracle Basic variable or expression
The return value is of the Single data type
You use the CSTR function to convert a string or expression into a value of data type String
CSTR ( expression )
expression
Can be any valid Oracle Basic variable or expression
The return value is of the String data type
You use the CVDATE function to convert a string or expression into a value of data type Date
CVDATE ( expression )
expression
Can be any valid Oracle Basic variable or expression
The return value is of the Date data type
You use the FIX function to convert a numeric expression into an integer by truncating its fractional part
FIX ( expression )
expression
Can be any valid Oracle Basic variable or expression
The return value is of the Integer data type
Trang 3You use the INT function to convert a numeric expression into an integer by rounding to the nearest value The rounding operation uses the absolute value of the expression to perform the round operation and then reapplies the sign of the original expression to the rounded value
INT ( expression )
expression
Can be any valid Oracle Basic variable or expression
The return value is of the Integer data type
You use the STR function to convert a number or numeric expression into a value of data type String STR provides a leading space for positive numbers
STR ( expression )
expression
Can be any valid Oracle Basic variable or expression
The return value is of the String data type
Date Functions
You use the DATE function to return the current system date of your operating system as a String data type No
arguments are required
DATE ()
The return value is of the String data type
You use the DATEADD function to return a time or date value as the result of adding any number of time intervals to a date variable or expression
DATEADD ( time_interval, num_interval, date )
time_interval A string expression that indicates the type of time interval to add to the date.
s or S—Second
n or N—Minute
h or H—Hour
Trang 4The date to add the time intervals to.
The return value is of the Date data type
You use the DATEDIFF function to return the number of time intervals between two specified dates
DATEDIFF ( time_interval, first_date, second_date )
time_interval A string expression that indicates the type of time interval to add to the date.
first_date A valid Oracle Basic date variable or expression
second_date
A valid Oracle Basic date variable or expression
The return value is of the Date data type
You use the DATEPART function to return the portion of a date value that corresponds to a specified time interval
DATEPART ( time_interval, date )
time_interval A string expression that indicates the type of time interval to add to the date.
Trang 5A valid Oracle Basic date variable or expression
The return value is of the Date data type
You use the DATESERIAL function to return the complete date with integer arguments representing year, month, and day
DATESERIAL ( year, month, day )
year An integer representing the year
month An integer representing the month.
day
An integer representing the day
The return value is of the Date data type
You use the DAY function to return a long value between 1 and 31 representing the day portion of the specified date value
DAY ( date )
date
A valid Oracle Basic date variable or expression
The return value is of the Long data type
You use the HOUR function to return an integer value between 0 (12:00 a.m.) and 23 (11:00 p.m.) representing the hour portion of the specified date value
HOUR ( date )
date
A valid Oracle Basic date variable or expression
The return value is of the String data type
You use the MINUTE function to return an integer value between 0 and 59 representing the minute portion of the specified date value
Trang 6MINUTE ( date )
date
A valid Oracle Basic date variable or expression
The return value is of the Integer data type
You use the MONTH function to return an integer value between 1 and 12 representing the month portion of the
specified date value
MONTH ( date )
date
A valid Oracle Basic date variable or expression
The return value is of the Integer data type
You use the NOW function to return the current system date of your operating system as a Date data type No arguments are required
NOW ()
The return value is of the Date data type
You use the SECOND function to return an integer value between 0 and 59 representing the second portion of the specified date value
SECOND ( date )
date
A valid Oracle Basic date variable or expression
The return value is of the Integer data type
You use the SYSDATE function to return the current system date of your operating system as a Date data type It is identical to the NOW function No arguments are required
SYSDATE ()
The return value is of the Date data type
You use the TIME function to return the current system time of your operating system as a String data type No
arguments are required
Trang 7TIME ()
The return value is of the String data type
You use the TIMESERIAL function to return the complete time with integer arguments representing hour, minute, and second
TIMESERIAL ( hour, minute, second )
hour An integer representing the hour
minute An integer representing the minute.
second
An integer representing the second
The return value is of the Date data type
You use the TIMEVALUE function to convert a string into a date return value
TIMEVALUE ( time_value )
time_value
A valid Oracle Basic date variable or expression representing a time value
The return value is of the Date data type
You use the WEEKDAY function to return an integer value between 1 (Sunday) and 7 (Saturday) representing the day
of the week portion of the specified date value
WEEKDAY ( date )
date
A valid Oracle Basic date variable or expression
The return value is of the Integer data type
You use the YEAR function to return an integer between 99 and 10,000, inclusive, that represents the year portion of the specified date value
YEAR ( date )
Trang 8A valid Oracle Basic date variable or expression
The return value is of the Integer data type
File Input and Output Functions
You use the CURDIR function to return the current path for the default drive (volume)
CURRDIR [[(] vol_id [)]]
vol_id
A string representing the drive or volume to search
The return value is of the String data type
You use the EOF function to test if the file pointer is at the end-of-file marker for the indicated file handle
EOF ( filenum )
filenum An integer number between 1 and 256 representing a file handle as a result of opening a file using the OPEN
command
The return value is of the Integer data type
You use the FREEFILE function to return an integer value between 1 and 256, inclusive, representing the next unused file number No arguments are required
FREEFILE ()
The return value is of the Integer data type
You use the INPUT function to return a string of characters read from a file opened in the input or binary mode
INPUT ( n, filenum )
n The number of characters to read from the file
filenum An integer number between 1 and 256 representing a file handle as a result of opening a file using the OPEN
command
The return value is of the String data type
Trang 9You use the LOC function to return the current location of the file pointer for the indicated file handle
LOC ( filenum )
filenum An integer number between 1 and 256 representing a file handle as a result of opening a file using the OPEN
command
The return value is of the Positive Integer data type
You use the LOF function to return the length (in bytes) of the specified file handle
LOF ( filenum )
filenum An integer number between 1 and 256 representing a file handle as a result of opening a file using the OPEN
command
The return value is of the Positive Integer data type
You use the SEEK function to return the position of the next input or output operation for the specified file handle
double-DDB ( asset_cost, salvage, life, period )
asset_cost The initial value paid for the asset.
salvage The projected value of the asset at the end of its life expectancy
life The length of time the asset is expected to be useful
Trang 10The length of time to calculate the asset's depreciation over
The return value is of the Double data type
You use the FV function to return the future value of an asset, such as an annuity, using a constant interest rate and constant periodic payments
FV ( rate, periods, payment, pv, due_end )
rate The fixed interest rate you estimate that you will be paying over the life of the annuity
periods The total number of payment periods over the life of the annuity
payment The fixed amount of the periodic payment.
pv The amount of the annuity
due_end 0 indicates that payments are due at the end of each period 1 indicates that payments are due at the
beginning of each period
The return value is of the Double data type
You use the IPMT function to return the amount applied to interest from a specified periodic payment on an annuity at a fixed interest rate and fixed periodic payments
IPMT ( rate, which_period, periods, pv, fv, due_end )
rate The fixed interest rate you estimate that you will be paying over the life of the annuity
which_period The period to calculate the amount applied to principal.
periods The total number of payment periods over the life of the annuity
pv The amount of the annuity
fv The amount of the annuity to be unpaid at the end of the life of the annuity
due_end 0 indicates that payments are due at the end of each period 1 indicates that payments are due at the
beginning of each period
Trang 11The return value is of the Double data type
You use the IRR function to return the internal rate of return for an investment, which is its rate of return based on a series of periodic cash flows, both payments and receipts
IRR ( cash_flow_array, estimate )
cash_flow_array An array that contains the values of a series of payments and receipts over the life of an investment
There must be at least one payment and one receipt
estimate
The fixed interest rate you estimate that you will be using over the life of the cash flow
The return value is of the Double data type
You use the MIRR function to return the modified internal rate of return on an investment, which is the rate of return represented by a series of periodic cash flows (payments and receipts) when the interest rates for payments and receipts are different
MIRR ( cash_flow_array, borrow_rate, reinvest_rate )
cash_flow_array An array that contains the values of a series of payments and receipts over the life of an investment
There must be at least one payment and one receipt
borrow_rate The interest rate you pay to borrow money
reinvest_rate
The interest rate you expect to earn when reinvesting cash received
The return value is of the Double data type
You use the NPER function to return the number of periods for an annuity with fixed interest rates and fixed periodic payments
NPER ( rate, periods, pv, fv, due_end )
rate The fixed interest rate you estimate that you will be paying over the life of the annuity
periods The total number of payment periods over the life of the annuity
pv The amount of the annuity
Trang 12fv The amount of the annuity to be unpaid at the end of the life of the annuity.
due_end 0 indicates that payments are due at the end of each period 1 indicates that payments are due at the
beginning of each period
The return value is of the Double data type
You use the NPV function to return the net present value of an investment using a constant discount rate and a series of cash flow values (payments and receipts)
NPV ( discount_rate, cash_flow_array )
discount_rate The discount rate that applies over the whole period being considered
cash_flow_array An array that contains the values of a series of payments and receipts over the life of an investment
There must be at least one payment and one receipt
The return value is of the Double data type
You use the PMT function to return the payment for an annuity with a fixed interest rate and fixed periodic payment
PMT ( rate, periods, pv, fv, due_end )
rate The fixed interest rate you estimate that you will be paying over the life of the annuity
periods The total number of payment periods over the life of the annuity
pv The amount of the annuity
fv The amount of the annuity to be unpaid at the end of the life of the annuity
due_end 0 indicates that payments are due at the end of each period 1 indicates that payments are due at the
beginning of each period
The return value is of the Double data type
You use the PPMT function to return the amount applied to the principal during one payment period for an annuity
PPMT ( rate, which_period, periods, pv, fv, due_end )
Trang 13rate The fixed interest rate you estimate that you will be paying over the life of the annuity.
which_period The period to calculate the amount applied to principal.
periods The total number of payment periods over the life of the annuity
pv The amount of the annuity
fv The amount of the annuity to be unpaid at the end of the life of the annuity
due_end 0 indicates that payments are due at the end of each period 1 indicates that payments are due at the
beginning of each period
The return value is of the Double data type
You use the PV function to return the present value of an annuity with a fixed interest rate and fixed periodic payments
PV ( rate, periods, payment, fv, due_end )
rate The fixed interest rate you estimate that you will be paying over the life of the annuity
periods The total number of payment periods over the life of the annuity
payment The fixed amount of the periodic payment.
fv The amount of the annuity to be unpaid at the end of the life of the annuity
due_end 0 indicates that payments are due at the end of each period 1 indicates that payments are due at the
beginning of each period
The return value is of the Double data type
You use the RATE function to return the interest rate per period for an annuity
RATE ( periods, payment, pv, fv, due_end, estimate )
periods The total number of payment periods over the life of the annuity
payment The fixed amount of the periodic payment.
Trang 14pv The amount of the annuity.
fv The amount of the annuity to be unpaid at the end of the life of the annuity
due_end 0 indicates that payments are due at the end of each period 1 indicates that payments are due at the
beginning of each period
estimate
The fixed interest rate you estimate that you will be paying over the life of the annuity
The return value is of the Double data type
You use the SLN function to return the depreciation of an asset's value for a single period using the straight-line method
SLN ( asset_cost, salvage, life )
asset_cost The initial value paid for the asset.
salvage The projected value of the asset at the end of its life expectancy
life
The length of time the asset is expected to be useful
The return value is of the Double data type
You use the SYD function to return the depreciation of an asset for a specified period using the sum-of-years-digits method
SYD ( asset_cost, salvage, life, period )
asset_cost The initial value paid for the asset.
salvage The projected value of the asset at the end of its life expectancy
life The length of time the asset is expected to be useful
period
The length of time to calculate the asset's depreciation over
The return value is of the Double data type
Trang 15General Functions
You use the ENVIRON function to return the string that corresponds to a specified Windows operating system
environment variable This function returns NULL on the Macintosh
ENVIRON ( environment )
environment
A string variable or expression that is an environment variable, such as PATH
The return value is of the String data type
You use the HEX function to return a string value representing the hexadecimal value (base 16) for a decimal or numeric expression (base 10)
HEX ( numeric_expression )
numeric_expression
Any valid Oracle Basic number or numeric expression
The return value is of the String data type
You use the OCT function to return a string value representing the octal value (base 8) for a decimal or numeric
expression (base 10)
OCT ( numeric_expression )
numeric_expression
Any valid Oracle Basic number or numeric expression
The return value is of the String data type
You use the PAGENUM function to return the number of the page being printed from within a report No arguments are required
PAGENUM ()
The return value is of the Integer data type
You use the RND function to return a single precision number in the range 0 <= x < 1
RND ( [ctrl_num] )