Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Sponsored Links

Discuss "VBScript Functions Reference" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). Visit the ASP Development forum for help with ASP/VBScript and ASP/JScript applications.


Closed Thread
 
LinkBack Thread Tools Display Modes
  #21  
Old May 13th, 2008, 08:01 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 941
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 5
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default 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 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  
Old May 13th, 2008, 08:07 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 941
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 5
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default 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") %>
  #23  
Old May 13th, 2008, 08:14 PM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 941
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 5
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default 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") %>
  #24  
Old June 16th, 2008, 10:13 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 941
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 5
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default 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") %>
  #25  
Old June 16th, 2008, 10:18 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 941
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 5
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default 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")
  #26  
Old October 21st, 2008, 08:31 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 941
Thanks: 22
Thanked 93 Times in 90 Posts
Blog Entries: 5
Rep Power: 4
jmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the roughjmurrayhead is a jewel in the rough

Awards Showcase
Microsoft Windows Microsoft SQL Server Microsoft .Net Classic ASP 
Total Awards: 4

Default 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) %>
Closed Thread

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -4. The time now is 07:12 AM.



Content Relevant URLs by vBSEO 3.2.0