Here are some of the SQL function usage I've collected on the internet for Informix, and anyone using the Informix library can take a look at it!
Today, return to the present system date
Current returns the date time, as compared to GETDATE () in SQL Server
Date (VARCHAR (10)) returns the date type of the function as a string variable, whose format is specified by the environment variable DBDATE and returns a date type. The format in Setnet32 must be "mdy4/".
Date (DATETIME) returns the date type this function is the same as the previous function, but its input parameters can be DATETIME of arbitrary precision.
Date (integer) returns a date type Integer that represents the number of days from December 31, 1899.
Day (DATE) returns an integer that returns the date of the month, formatted as an integer.
Day (DATETIME) is the same as the previous function, except that the input parameters of this function are datetime of arbitrary precision.
EXTEND (DATE, precision) returns a DATETIME type
The EXTEND functions adjust the precision of the DATE parameters and return the appropriate DATETIME. As a bit vague, here's an example: EXTEND (DATE (1), year to SECOND)
EXTEND (datetime, precision) returns a DateTime type that is the same as the previous function, but the action's image is a datetime, not a DATE.
Month (DATE) returns an integer type month that is extracted from the DATE of the parameters.
Month (DATETIME) returns the integer type of the function that extracts the month from the DATETIME of any precision.
WEEKDAY (DATE) returns an integer type WEEKDAY function that returns an integer based on the specified DATE, representing the day of the week. 0 represents Sunday, 6 represents Saturday.
WEEKDAY (DATETIME) returns an integer type that is the same as the previous function, but the operation is DateTime.
Year (DATE) returns an integer that specifies the number of years that the function extracts from the specified DATE of the parameters.
Year (DATETIME) returns an integer type that is the same as the previous function, but operates on an image that is DateTime.
MDY (Integer, Integer, Integer) returns the date type of the function based on three INTEGER parameters to create a date. These parameters specify the month, day, and year. Note that the year is a four-bit integer.
mdy--usage Gets the first day of the month MDY (today), 1,year (today)
Get the last day of the month MDY (today), 1,year (today)-1 + 1 UNITS Month
Get the first day of last month MDY (today), 1,year (Today) – 1 UNITS Month
Get the last day of the month MDY (today), 1,year (today)-1
To_char (DATE, varchar (?)) returns a varchar (??) type that functions with a date and a format, and returns a String representing the date, which is in the required format. The format string can include:%A: Week%B: Month%d: Ten in the day%y:4 representation of the annual%R: by 24 hours of time to_char (DATE, varchar (?)) returns the VARCHAR (??) type Ibid. To_date (varchar (?)), varchar (??)) returns the DATE type this is the inverse operation of the To_char, using the same format string as the second argument the following sentence is extend used to limit the number of years, months, and days, interval is the interval Minus (plus) the number of days, interval up to two digits from the Time_stamp field minus two days time select Extend (Time_stamp-interval (2) day to day) from users;
From time to time minus two days select Extend (Current-interval (2) Day-to-day) from users; Minus (plus) the number of months, interval up to two digits from the Time_stamp field minus two months. Select Extend (Time_stamp-interval (2) month to month) from users;
Minus two months from the time. Select Extend (Current-interval (2) month to month) from users; Minus (plus) years, interval up to four bits minus two years from the Time_stamp field. Select Extend (Time_stamp-interval (2) year-year) from users;
From time to time minus two years select Extend (Current-interval (2) year to year) from users; Try, the above notation will be shown to milliseconds, such as 2004-09-11 17:24:03.000 2004-09-11 17:24:03.000 2004-09-11 17:24:03.000
You can add a extend limit, as shown below to the month Select Extend ((((Extend (Current-interval (2) days to day)), year to month) from users;
Shown to days Select Extend ((((Extend (Current-interval (2) month to month)) from users;
Displayed to the second select Extend ((((Extend (Current-interval (2) year to year)), year to second) from users; This is one of the methods, there is another use, you can use the Units keyword. --current-5 units year from users--month select current-5 units month from users--Daily select current-5 units Day from Users--Select CURRENT-5 units Hour from users--select current-5 units minute from users-seconds select current-5 units Second from users
http://yangxinde.pixnet.net/blog/post/23874960-informix-%E6%99%82%E9%96%93%E6%A0%BC%E5%BC%8F%E7%9A%84%E5%90%84 %e7%a8%ae%e7%94%a8%e6%b3%95
Various uses of the informix-format