![]() |
| |||||||
| Sponsored Links |
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#21
| ||||
| ||||
| 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 with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.If you like it here...throw us a few bones to help support us. Join our Folding team: DeveloperBarn Folding |
| Sponsored Links |
|
#22
| ||||
| ||||
| 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") %>
|
|
#23
| ||||
| ||||
| 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") %>
|
|
#24
| ||||
| ||||
| 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") %>
|
|
#25
| ||||
| ||||
| 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")
|
|
#26
| ||||
| ||||
| 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) %> |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|