Time function application

xiaoxiao2021-03-06  78

Date Function Description: Returns the current system date. Syntax DatedateAdd Differential Description: Returns the date that has been added specified time interval. Syntax Dateadd (Interval, Number, Date) Interval: must. String expressions indicate the time interval to be added. For values, see the "Settings" section. Number: It is necessary. Numerical expression indicates the number of time intervals to be added. Numerical expressions can be positive (getting a date) or a negative number (obtained by the past). Date: must. VARIANT or the text of the representation of Interval. The interval parameter can have the following values: YYYY (Year), Q (Quarter), M (Month), Y (Day number of days), D (day), W (a week), ww (week), h (hour) ), N (minutes), s (second) Description: The specified time interval can be added or subtracted from the date available from the dateAdd function. For example, you can use DateAdd from the date of 30 days after the day or after 45 minutes now. To add a time interval in "Day" to Date, you can use the "one year" ("y"), "day" ("D") or "one day number" ("W"). The dateAdd function will not return an invalid date. The following example plus one month on January 31, 95: NewDate = dateadd ("M", 1, "31-JAN-95") In this example, DateAdd returned to February 28, 95, not 95 years. February 31. If DATE is January 31, 96, it returns to February 29, 96, because 1996 is a leap year. If the calculated date is 100 years ago, an error will occur. If NUMBER is not a LONG value, it is closest to the closest integer before calculating. Datediff function description: Returns the time interval between two dates. Syntax Datediff (Interval, Date1, Date2 [, FirstDayofweek [, Firstweekofyear> "Interval: must. String expressions indicate time intervals for calculating DATE1 and DATE2. For values, see the "Settings" section. Date1, date2: must. Date expression. Two dates used to calculate. Firstdayofweek: Optional. Specifies the constant of the first day in the week. If not specified, the default is Sunday. For values, see the "Settings" section. FIRSTWEEKOFYEAR: Optional. Specifies the constant of the first week in the year. If you don't specify, the Week of January 1 is the week. For values, see the "Settings" section. The interval parameter can have the following values: YYYY (Year), Q (Quarter), M (Month), Y (Day number of days), D (day), W (a week), ww (week), h (hour) ), N (minutes), s (second) The firstdayofweek parameter can have the following values: (below: constant value description) VbuseSystem 0 Use the Region Language Support (NLS) API setting. Vbsunday 1 Sunday (default) VBMONDAY 2 Monday VBTESDAY 3 Tuesday VBwednesday 4 Wednesday VBTHURSDAY 5 Thursday VBFriday 6 Friday VBSATURDAY 7 Saturday Firstweekofyear parameters can have the following values: (below: constant value description) VBusesystem 0 Use area language support (NLS) API settings. VBFirstJAN1 1 starts from the week of January 1 (default).

VBFirstfourDays 2 starts with at least four days in the New Year. VBFirstfulWeek 3 starts with the first complete week in the new year. Note The dateDiff function is used to determine the number of specified time intervals existing between two dates. For example, you can use Datediff to calculate the number of days of the difference between the two dates, or the number of days between the last day of the year. To calculate the number of days of Date1 and Date2, you can use the "One Year" ("Y") or "Day" ("D"). When Interval is "a week" ("W"), DateDiff returns the number of days between two dates. If DATE1 is Monday, DateDiff calculates the number of days before DATE2. This result contains DATE2 without containing DATE1. If Interval is "Week" ("WW"), the dateDiff function returns the number of days between the two dates in the calendar. The function calculates the number of days between Date1 and Date2. If DATE2 is Sunday, DateDiff will calculate DATE2, but even if Date1 is Sunday, Date1 will not be calculated. If DATE1 is later than DATE2, the dateDiff function returns a negative number. The FirstdayOfweek parameter affects the calculation of "W" and "WW" interval symbols. If DATE1 or DATE2 is the date text, the specified year will become a fixed part of the date. However, if Date1 or Date2 is included in quotation marks ("") and omitted year, the current year is inserted each time the Date1 or Date2 expression is calculated every time the code is calculated. This will be written for program code applicable to different years. When INTERVAL is "YYYY", compare January 1, December 31, while actually only differ one day, DateDiff returns 1 indicates a year of different years. DatePart function description: Returns the specified section of the given date. Syntax DatePart (Interval, Date [, Firstdayofweek [, Firstweekofyear>) DatePart: The syntax of the function has the following parameters: Interval: must. String expression indicates the time interval to return. For values, see the "Settings" section. Date: must. The date expressions to calculate. Firstdayof Week: Optional. Specifies the constant of the first day in the week. If not specified, the default is Sunday. For values, see the "Settings" section. FIRSTWEEKOFYEAR: Optional. Specifies the constant of the first week in the year. If you don't specify, the Week of January 1 is the week. For values, see the "Settings" section. The interval parameter can have the following values: YYYY (Year), Q (Quarter), M (Month), Y (Day number of days), D (day), W (a week), ww (week), h (hour) ), N (minutes), s (second) The firstdayofweek parameter can have the following values: (below: constant value description) VbuseSystem 0 Use the Region Language Support (NLS) API setting. Vbsunday 1 Sunday (default) VBMONDAY 2 Monday VBTESDAY 3 Tuesday VBwednesday 4 Wednesday VBTHURSDAY 5 Thursday VBFriday 6 Friday VBSATURDAY 7 Saturday Firstweekofyear parameters can have the following values: (below: constant value description) VBusesystem 0 Use area language support (NLS) API settings.

VBFirstJAN1 1 starts from the week of January 1 (default). VBFirstfourDays 2 starts with at least four days in the New Year. VBFirstfulWeek 3 is started by the first complete week (short year) in the new year. Note The datePart function is used to calculate the date and return to the specified time interval. For example, using datepart calculates a day is a day or the current time. The firstdayofweek parameter affects the calculation using "W" and "WW" interval symbols. If DATE is a date text, the specified year will become a fixed part of the date. However, if Date is included in quotation marks (""), and the year is omitted, the current year will be inserted each time the Date expression is calculated. This will be written for program code applicable to different years. DateSerial Function Description: For the specified year, month, day, return to the Date subtype of Variant. Syntax DateSerial (Year, Month, Day) Year: Digital or numerical expression between 100 to 9999. Month: Any numerical expression. Day: Any numerical expression. Description: To specify the date, such as December 31, 1991, the value range of each parameter in the DateSerial function should be acceptable; the next value should be between 1 and 31, the monthly value should be 1 And 12 between 12. However, you can also use the numerical expression that represents the year, month, month, monthly, and daily number of days before a certain day, specifies the relative date for each parameter. A numerical expression is used instead of an absolute date in the following examples. Here, the DateSerial function returned before August 1, 1990 (1990 - 10) for 2 months (8 - 2) Day (1 - 1) Date: May 31, 1980. DateSerial (1990 - 10, 8 - 2, 1 - 1) For year parameters, if the value ranges from 0 to 99, it is explained as 1900 to 1999. For the Yearar parameters other than this range, the four digits represent the year (for example, 1800). When the value of any of the parameters exceeds an acceptable range, it will be appropriately carried out to the next larger time unit. For example, if you specify 35 days, the number of days is explained as many days in the month, and the number of days, depending on its year and month. However, if the parameter value exceeds -32, 768 to 32, 767, or if the date specified by three parameters (whether direct or through expressive specified) is exceeded, an error occurs. DateValue Function Description: Returns a Variant of the Date subtype. The syntax DateValue (date) Date parameter should be a string expression, which means a date from January 1, 9999 to December 31, 9999. However, DATE may also be any expression indicating a date, time, or date time of the above range. Note: If the Date parameter contains time information, DateValue will not return time information. However, if Date contains invalid time information (such as "89:98"), there will be an error. If DATE is a string, only the numbers separated by a valid date separator, the DateValue will identify the order of the month, day and years based on the short date format specified for the system. DateValue also identifies a clear date that contains the month name (whether full name or abbreviation). For example, in addition to being able to identify 12/30/1991 and 12/30/91, DateValue can also identify DECEMBER 30, 1991, and DEC 30, 1991.

If the date of Date is omitted, DateValue will use the current year in the computer system date. DAY function description: Returns an integer between 1 and 31 (including 1 and 31), representing one day in the month. The syntax day (date) Date parameter is an expression that can represent a date. Returns NULL if the Date parameter contains NULL. FormatDateTime function description: Return expression, this expression is formatted as a date or time. Syntax: formatdatetime (date [, namedformat]) Date: must be selected. The date expression to be formatted. NamedFormat: Optional. Indicates the value of the date / time format used, if omitted, use VBGeneLDate. The NamedFormat parameter can have the following values: (below: constant value description) VBGeneralDate 0 displays the date and / or time. If there is a date part, the part is displayed as a short date format. If there is a time part, the part is displayed as a long-time format. If all exist, all parts are displayed. VBlongDate 1 displays the date using the long-term format specified in your computer zone setting. VBShortDate 2 Displays the date using the short date format specified in the computer area settings. VBlongTime 3 Displays time using the time format specified in the computer area setting. VBShortTime 4 shows time using 24-hour format (HH: mm). Hour function description: Returns an integer (including 0 and 23) between 0 to 23, representing an hour in the day. Syntax: HOUR (TIME) TIME parameter is an expression that can represent time. Returns NULL if the Time parameter contains NULL. Minute function description: Returns an integer (including 0 and 59) between 0 and 59, representing a minute within an hour. Syntax: The Minute (TIME) Time parameter is an expression that can represent time. Returns NULL if the Time parameter contains NULL. Month Function Description: Returns an integer (including 1 and 12) between 1 and 12, representing a month of one year. Syntax: Month Date parameter is an expression that can represent the date. Returns NULL if the Date parameter contains NULL. MONTHNAME function description: Returns a string that indicates the specified month. Syntax: MONTHNAME (Month [, Abbreviate]) MONTH: must be selected. Value definition of months. For example, January is 1, February is 2, and so on. ABBREVIATE: Optional. Boolean value indicates whether the month name is short-handed. If omitted, the default value is false, ie not the month name. NOW function description: Returns the current date and time value based on the date and time set by the computer system. Syntax: NowSecond Function Description: Returns an integer between 0 and 59 (including 1 and 59), representing some seconds within a minute. Syntax: Second (TIME) Time parameter is an expression that can represent time. Returns NULL if the Time parameter contains NULL. Time Function Description: Returns Date Sub Type Variant, indicating the current system time. Syntax: TimetimeSerial Function Description: Returns a Date subtype of Variant, with a specified time, minute, second. Syntax: TimeSerial (Hour, Minute, Second) Hour: The value is from 0 (12:00 A.M.) to 23 (11:00 p.m.) value or numerical expression. Minute: Any numerical expression. SECOND: Any numerical expression.

Description: To specify a moment, such as 11: 59: 59, TimeSerial parameters should be within acceptable range; that is, the hour should be between 0-23, and the second should be 0-59 between. However, you can use a numerical expression to specify a relative time for each parameter, which represents the time, minutes or seconds of time before or after a certain time. The expression is used in the following examples instead of the absolute time. The TimeSerial function returns six hours (12 - 6) fifteen minutes before noon (-15), namely 5:45:00 A.m .. TimeSerial (12 - 6, -15, 0) When the value of any parameter is exceeded, it will carry it correctly into the next larger time unit. For example, if you specify 75 minutes, this time is interpreted to be a 10 or fifteen minutes. However, if any of the parameter values ​​exceeds the range of -32768 to 32767, it will cause errors. If the time specified by three parameters is specified or the time calculated by the expression exceeds the acceptable date range, it will also cause errors. TimeValue function description: Returns a Variant that contains time-containing Date subtypes. Syntax: TimeValue (TIME) Time parameter is usually represented from 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 PM) string expressions (including 0:00: 00 and 23:59:59). However, TIME can also be an expression representative of any time in the range. Returns NULL if the Time parameter contains NULL. Note: You can use a 12 or 24-hour clock format input time. For example, "2: 24 pm" and "14:24" are valid TIME parameters. If the TIME parameter contains date information, the TimeValue function does not return date information. However, if the TIME parameter contains invalid date information, an error occurs. WeekDay function description: Returns an integer representing a day a week. Syntax: Weekday (Date, [Firstdayofweek]) Date: Any expression that can represent the date. Returns NULL if the Date parameter contains NULL. Firstdayofweek: Specifies the constant of the first day in the week. If omitted, VBSunday is used by default. The firstdayofweek parameter has the following settings: (below: constant value description) VbuseSystem 0 Use the Region Language Support (NLS) API setting. vbSunday 1 Sunday vbMonday 2 vbTuesday 3 Monday Tuesday Wednesday vbThursday 5 vbWednesday 4 vbFriday 6 Thursday Friday Saturday vbSaturday 7 :( Weekday function can return the following values ​​are: Constant Value Description) vbSunday 1 Sunday vbMonday 2 vbTuesday 3 Monday Tuesday Wednesday vbWednesday 4 VBTHURSDAY 5 Thursday VBFriday 6 Friday VBSATURDAY 7 Saturday WeekDayName function description: Return a string, indicating a day specified in the week. Syntax: WeekdayName (Weekday, Abbreviate, Firstdayofweek) Weekday: Value definitions in a day of the week. Numerical definitions in each day depend on the FIRSTDAYOFWEEK parameter setting. ABBREVIATE: Optional. Boolean value indicates whether abbreviation represents the name of the day of the week. If omitted, the default value is false, that is, the name of the day of the week does not qurk. Firstdayofweek: Optional. Specifies the value of the first day of the week. For a value, see the "Settings" section.

转载请注明原文地址:https://www.9cbs.com/read-121746.html

New Post(0)