Time Stamp

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Houston

    Time Stamp

    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_e ditAction%>">
    <table width="500" cellpadding="2" cellspacing="0" >
    <tr>
    <td width="242" class="tdtl">Ar e you coming to the lake this weekend?
    </td>
    <td width="244" class="tdtr"><i nput 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="Wednesda y">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_val idateForm('Name ','','R');retur n document.MM_ret urnValue"
    value="Submit"> </td>
    </tr>
    </table>

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

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

    Thanks

    Houston




  • Bradley

    #2
    Re: Time Stamp

    "Houston" <houston@hbip.c om> wrote in message
    news:0oZRc.4471 $RH7.1920@newss vr23.news.prodi gy.com[color=blue]
    > 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:[/color]

    <snip>
    [color=blue]
    > <input type="hidden" name="MM_insert " value="form1">
    > <span class="tdright" >
    > <input name="TimeStamp " type="hidden" id="TimeStamp"
    > value="<%=(rsLi st.Fields.Item( "TimeStamp").va lue)%>">
    > </span>
    > </form>
    >
    > Is it this last "Input" statement that I need to change to get this
    > to work right?
    >
    > Thanks
    >
    > Houston[/color]

    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("Timesta mp") = Now() %>

    (Note: rsList(Timestam p") 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


    Comment

    • Houston

      #3
      Re: Time Stamp

      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" <spam_no@blockm ail.com> wrote in message
      news:41187004_2 @news.melbourne .pipenetworks.c om...[color=blue]
      > "Houston" <houston@hbip.c om> wrote in message
      > news:0oZRc.4471 $RH7.1920@newss vr23.news.prodi gy.com[color=green]
      > > 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:[/color]
      >
      > <snip>
      >[color=green]
      > > <input type="hidden" name="MM_insert " value="form1">
      > > <span class="tdright" >
      > > <input name="TimeStamp " type="hidden" id="TimeStamp"
      > > value="<%=(rsLi st.Fields.Item( "TimeStamp").va lue)%>">
      > > </span>
      > > </form>
      > >
      > > Is it this last "Input" statement that I need to change to get this
      > > to work right?
      > >
      > > Thanks
      > >
      > > Houston[/color]
      >
      > 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("Timesta mp") = Now() %>
      >
      > (Note: rsList(Timestam p") 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
      >
      >[/color]


      Comment

      Working...