|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
dates v's strings
Hi,
wot i want to do is read in a date in the mm/dd/yyyy format from the sql databse and then set 3 variables, month, day and year equal to mm dd and yyyy...... pristr = "exec test " rs.Open pristr,cn1 if (rs.EOF) or (rs.BOF) then Response.Write ("Sorry there is no Records found for today. - ") Response.Write(" Try Some other time.") Response.End end if rs.MoveFirst %> <% while not rs.EOF temp = rs("date1") .............................................................. %> so i have the temp = to date but now i want 3 other variables: Dim day, month, year so my question is how do i asign the correct value to each from temp? |
|
#2
|
|||
|
|||
|
Dim dYear
Dim dMonth Dim dDay dYear = Year(Cdate(temp)) dMonth = Month(Cdate(temp)) dDay = Day(Cdate(temp)) 'FOR DEBUG ONLY Response.Write "Year = " & dYear & "<br>" Response.Write "Month = " & dMonth & "<br>" Response.Write "Day = " & dDay & "<br>" Response.End Hope this helps! Sincerely Vlince |
|
#3
|
|||
|
|||
|
Perfect,
merci! |
|
#4
|
|||
|
|||
|
Oh...Francais :-)
C'est rare...ici De rien |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > dates v's strings |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|