+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3
Results 21 to 26 of 26

Thread: VBScript Functions Reference

  1. #21
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    DatePart

    Syntax - DatePart(Interval, Date, FirstDayofWeek, FirstWeekofYear)

    Interval - The Interval argument designates the the type of time interval.

    Date - The Date argument is the date and time you designate.
    FirstDayofWeek - The FirstDayofWeek argument must only use the constants or values defined below in the Date And Time CONSTANTS.
    FirstWeekofYear - The FirstWeekofYear argument must only use the constants or values defined in the Date And Time CONSTANTS which are listed above.
    The DatePart function returns the designated part of the date.

    Possible interval settings:
    YYYY -Year
    Q - Quarter
    M - Month
    Y - Day Of Year
    D - Day
    W - WeekDay
    WW - Week Of Year
    H - Hour
    N - Minute
    S - Second

    CONSTANT, VALUE, DESCRIPTION
    VBSunday, 1, Sunday
    VBMonday, 2, Monday
    VBTuesday, 3, Tuesday
    VBWednesday, 4, Wednesday
    VBThursday, 5, Thursday
    VBFriday, 6, Friday
    VBSaturday, 7, Saturday
    VBFirstJan1, 1, Week of January 1
    VBFirstFourDays, 2, First week of the year thathas at least four days
    VBFirstFullWeek, 3, First full week of the year
    VBUseSystem, 0, Use the date format of the computer's regionsl settings
    VBUseSystemDayOfWeek, 0, Use the first full day of the week as defined by the system settings

    Example(s):

    Code:
    This will output 5/13/08 13
    <% =Date %> 
    <% =DatePart("D", Date) %>
     
    This will output 7
    <% =DatePart("W", 1/1/2000) %>
     
    This will output 52
    <% =DatePart("WW", "12/31/1999", 1, VBFIRSTFULLWeek) %> 
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  2. #22
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    DateSerial

    Syntax - DateSerial(Year, Month, Day)

    Year - The Year argument is the year as a string or integer.Month - The Month argument is the month as a string or integer.Day - The Day argument is the Day as a string or integer.
    The DateSerial function converts the arguments into the variant of subtype Date.

    Example(s):

    Code:
    This will output 5/13/08
    <% =DateSerial(2008, 5, 13) %>
     
    This will output 5/13/08
    <% =DateSerial("08", "5", "13") %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #23
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    DateValue

    Syntax - DateValue(Date)

    The DateValue function converts an argument into the variant of subtype Date.

    The Date argument must be a string in valid date format or you will get an error message.

    Example(s):

    Code:
    This will output 5/13/2008
    <% mystring = "05/13/2008" %> 
    <% =DateValue(mystring) %>
     
    This will output 3/1/2001
    <% =DateValue("3/1/2001") %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  4. #24
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Day

    Syntax - Day(date)

    The Day function returns the number of the current day of the month using any valid date expression as an argument.

    You can also use the Date and Now functions as the argument.

    Example(s):

    Code:
    'This will output 16
    <% =Day(Date) %>
     
    'This will ouput 12
    <% =Date("5/12/2008") %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  5. #25
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Eval

    Syntax - Eval(Expression)

    The Eval function takes a single argument, evaluates it as a VBScript expression, and returns the result of this evaluation.

    If the expression is of the form a = b, it is treated as an equality comparison. If the comparison is true, then True is returned. Otherwise, False is returned.

    Example(s):
    Code:
    'This will ouput True
    Dim var1, var2
    var1 = 5.6
    var2 = 5.6
     
    Eval("var1 = var2")
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  6. #26
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,545
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Exp

    Syntax - Exp(Number)

    The Exp function raises e to the power of a number.

    There is a companion function Log for the reverse operation.

    Example(s):
    Code:
    'This will output 26.2850411552082
    <% =Exp(3.269) %>
    
    'This will output 0.038044452511799
    <% =Exp(-3.269) %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO