faqts : Computers : Programming : Languages : Asp : ASP/VBScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

20 of 28 people (71%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How do you convert from Integer to Date i.e. 20010324 to 2001/03/24

Oct 16th, 2001 06:57
Luiz Paulo Rosa, Ram Kathir,


You must compose a variable that is date format compatible then use the 
CDate function (convert to date).
Var1 = "20010324"
dateVar1 = Left(Var1,4) & "/" & Mid(Var1,5,2) & "/" & Right(Var1,2)
Var2 = CDate(dateVar1)
You can use functios like DateAdd with Var2 now.
I hope this can be useful



© 1999-2004 Synop Pty Ltd