Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: date/time!


Message #1 by "Lady in Black" <phoenix1310@h...> on Wed, 24 Apr 2002 13:42:37 +0800
hai....
can u all help me......how to store date/time in database??
thank...


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

Message #2 by "Ken Schaefer" <ken@a...> on Wed, 24 Apr 2002 16:18:18 +1000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Lady in Black" <phoenix1310@h...>
Subject: [access_asp] date/time!


:
: hai....
: can u all help me......how to store date/time in database??
: thank...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

What database? What date/time?

Also, have you heard of a spell checker?

<rant>
Messages like this seem to indicate to me that you haven't really spent any
time solving the problem, or even in composing your message. Why should I
spend any time trying to help?
</rant>

Cheers
Ken

Message #3 by "Ken Schaefer" <ken@a...> on Wed, 24 Apr 2002 16:19:52 +1000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Lady in Black" <phoenix1310@h...>
Subject: [access_asp] date/time!


: hai....
: can u all help me......how to store date/time in database??
: thank...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Forget my last message - database is obviously Access, doh! Apologies.

<%
dteDate = Date()
dteDate = Year(dteDate) & "/" & Month(dteDate) & "/" & Day(dteDate)

strSQL = _
    "INSERT INTO table1 (DateField) VALUES (#" & dteDate & "#)"

Response.Write(strSQL)
%>

Cheers
Ken

Message #4 by jake williamson 28 <jake.williamson@2...> on Wed, 24 Apr 2002 10:29:49 +0100
hi!

just found this, very smart - basically builds the date pop up menu's for
you (day, month, year)

means you dont have to type all the codes in! wicked.

hope this helps,

jake


<%@ Language=VBScript %>
<html>
<head>
<title></title>
</head>
<body bgcolor= #FFFFFF leftmargin="10" topmargin="10" marginwidth="10"
marginheight="10">
<table border="0" cellspacing="5" cellpadding="0">
<tr>
<td>
<select id=selectday name=mnyDay>
<option value="select" selected>select</option>
<%
Dim I
for I = 1 to 31
Response.Write(vbNewLine)
if I = Day(date) then
Response.Write("<OPTION value=" & I & ">" & I & "</OPTION>")
else
Response.Write("<OPTION value=" & I & ">" & I & "</OPTION>")
end if
next
%>
</select>
</td>
<td>
<select id=selectmonth  name=mnuMonth>
<option value="select" selected>select</option>
<%
for I = 1 to 12
Response.Write(vbNewLine)
if I = Month(date) then
Response.Write("<OPTION value=" & MonthName(I) & ">" & MonthName(I) &
"</OPTION>")
else
Response.Write("<OPTION value=" & MonthName(I) & ">" & MonthName(I) &
"</OPTION>")
end if
next
%>
</select>
</td>
<td>
<select id=selectyear name=mnuYear>
<option value="select" selected>select</option>
<%
for I = 1900 to 2000
Response.Write(vbNewLine)
if I = Year(date) then
Response.Write("<OPTION value=" & I & ">" & I & "</OPTION>")
else
Response.Write("<OPTION value=" & I & ">" & I & "</OPTION>")
end if
next
%>
</select>
</td>
</tr>
</table>
</body>
</html>


  Return to Index