By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,940 Members | 614 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,940 IT Pros & Developers. It's quick & easy.

Time Stamp

P: n/a
I am pretty new at this so please bare with me.

I have a page working perfectly but I just want to ad a column that will
show the time it was entered into the database. I think all I need is the
syntax for writing the server time to the TimeStamp field in the record. I
have hidden field in the form that I alocated. So how do I get it to write
the current time to the database. Here is the current code:
<form name="form1" method="POST" action="<%=MM_editAction%>">
<table width="500" cellpadding="2" cellspacing="0">
<tr>
<td width="242" class="tdtl">Are you coming to the lake this weekend?
</td>
<td width="244" class="tdtr"><input name="Answer" type="radio"
value="Yes" checked>
Yes&nbsp;&nbsp;&nbsp; <input name="Answer" type="radio"
value="No">
No</td>
</tr>
<tr>
<td class="tdleft">Your Name Please </td>
<td class="tdright"><input name="Name" type="text" id="Name"
size="40"></td>
</tr>
<tr>
<td class="tdleft">I will be arriving on . . . </td>
<td class="tdright"><select name="Arriving" size="1" id="Arriving">
<option value="Cant make it">Cant make it</option>
<option value="Friday">Friday</option>
<option value="Saturday">Saturday</option>
<option value="Sunday">Sunday</option>
<option value="Monday">Monday</option>
<option value="Tuesday">Tuesday</option>
<option value="Wednesday">Wednesday</option>
<option value="Thursday">Thursday</option>
</select></td>
</tr>
<tr>
<td class="tdleft">Boathouse</td>
<td class="tdright"><input name="BoatHouse" type="text" id="BoatHouse"
size="6" maxlength="6">&nbsp;&nbsp; </td>
</tr>
<tr align="center">
<td colspan="2" class="tdleft"><input name="Submit" type="submit"
onClick="MM_validateForm('Name','','R');return document.MM_returnValue"
value="Submit"></td>
</tr>
</table>

<input type="hidden" name="MM_insert" value="form1">
<span class="tdright">
<input name="TimeStamp" type="hidden" id="TimeStamp"
value="<%=(rsList.Fields.Item("TimeStamp").value)% >">
</span>
</form>

Is it this last "Input" statement that I need to change to get this to work
right?

Thanks

Houston


Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Houston" <ho*****@hbip.com> wrote in message
news:0o*****************@newssvr23.news.prodigy.co m
I am pretty new at this so please bare with me.

I have a page working perfectly but I just want to ad a column that
will show the time it was entered into the database. I think all I
need is the syntax for writing the server time to the TimeStamp field
in the record. I have hidden field in the form that I alocated. So
how do I get it to write the current time to the database. Here is
the current code:
<snip>
<input type="hidden" name="MM_insert" value="form1">
<span class="tdright">
<input name="TimeStamp" type="hidden" id="TimeStamp"
value="<%=(rsList.Fields.Item("TimeStamp").value)% >">
</span>
</form>

Is it this last "Input" statement that I need to change to get this
to work right?

Thanks

Houston


You could, but that would get the local time???

If you are setting the timestamp shouldn't you just have some script in
the code that processes the form and adds the record? eg. <%
rsList("Timestamp") = Now() %>

(Note: rsList(Timestamp") is just shorthand as .Field.Item is the
default property)

Are you using Access as the back end database? You could set the
"default value" of that field in the table to = Now() (returns date &
time). If using MSSQL you could use a stored procedure to add the record
and that would set the timestamp.
--
regards,

Bradley
Nov 13 '05 #2

P: n/a
I appreciate your help, I ended up just putting in a Hidden field and had it
write the current time into the "TimeLog" column of an access database using
"Value = <% NOW() %>" Works great

Thanks again.

"Bradley" <sp*****@blockmail.com> wrote in message
news:41********@news.melbourne.pipenetworks.com...
"Houston" <ho*****@hbip.com> wrote in message
news:0o*****************@newssvr23.news.prodigy.co m
I am pretty new at this so please bare with me.

I have a page working perfectly but I just want to ad a column that
will show the time it was entered into the database. I think all I
need is the syntax for writing the server time to the TimeStamp field
in the record. I have hidden field in the form that I alocated. So
how do I get it to write the current time to the database. Here is
the current code:


<snip>
<input type="hidden" name="MM_insert" value="form1">
<span class="tdright">
<input name="TimeStamp" type="hidden" id="TimeStamp"
value="<%=(rsList.Fields.Item("TimeStamp").value)% >">
</span>
</form>

Is it this last "Input" statement that I need to change to get this
to work right?

Thanks

Houston


You could, but that would get the local time???

If you are setting the timestamp shouldn't you just have some script in
the code that processes the form and adds the record? eg. <%
rsList("Timestamp") = Now() %>

(Note: rsList(Timestamp") is just shorthand as .Field.Item is the
default property)

Are you using Access as the back end database? You could set the
"default value" of that field in the table to = Now() (returns date &
time). If using MSSQL you could use a stored procedure to add the record
and that would set the timestamp.
--
regards,

Bradley

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.