ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 5th, 2003, 02:49 PM
coconol coconol is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 6 coconol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 40 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old September 5th, 2003, 02:57 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #3  
Old September 5th, 2003, 03:01 PM
coconol coconol is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 6 coconol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 40 sec
Reputation Power: 0
Perfect,
merci!

Reply With Quote
  #4  
Old September 5th, 2003, 03:07 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Oh...Francais :-)

C'est rare...ici

De rien

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > dates v's strings


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway