gradinumcp
IS-IT--Management
Hi! I want to update a TimeStamp field in my database to this format:-5/11/2005 10:00:00 AM.
So in my ASP code I have the following form. It produces an input box where the time has to be entered and the AM/Pm has to be selected froma drop-down menu.
***************************************
<form ACTION ="" method=POST name="Page2">
<table>
<td><input class=fields maxlength="8" name="timer" Value=""></td>
<td>
<td><select name=timertype class=fields >
<option></option>
<option value="AM">AM</option>
<option value="PM">PM</option>
</select></td>
</td>
<td>e.g: 01:30:00 PM</td>
</tr>
<tr>
<td><input type=submit value="Update"></td>
</tr>
</table>
*******************************************
The Year, Month and Day are taken from a drop-down menu.
The SQL works in the SQL query analyzer when i enter some numbers. However when i integrate it into the ASP code it doesn't.
The is the SQL query:-
mysql="Update TimeTable set TimeStamp='"& request("Year") &"-"& request("Month") &"-"& request("Day") &" "&request("timer")&" "&request("timertype")&"' where UserID='"& request("Employee") &"' AND DateStamp='"& request("Year") &"-"& request("Month") &"-"& request("Day") &"' AND TimeID='"& rs("TimeID") &"'"
con.execute(mysql)
Any clues????
So in my ASP code I have the following form. It produces an input box where the time has to be entered and the AM/Pm has to be selected froma drop-down menu.
***************************************
<form ACTION ="" method=POST name="Page2">
<table>
<td><input class=fields maxlength="8" name="timer" Value=""></td>
<td>
<td><select name=timertype class=fields >
<option></option>
<option value="AM">AM</option>
<option value="PM">PM</option>
</select></td>
</td>
<td>e.g: 01:30:00 PM</td>
</tr>
<tr>
<td><input type=submit value="Update"></td>
</tr>
</table>
*******************************************
The Year, Month and Day are taken from a drop-down menu.
The SQL works in the SQL query analyzer when i enter some numbers. However when i integrate it into the ASP code it doesn't.
The is the SQL query:-
mysql="Update TimeTable set TimeStamp='"& request("Year") &"-"& request("Month") &"-"& request("Day") &" "&request("timer")&" "&request("timertype")&"' where UserID='"& request("Employee") &"' AND DateStamp='"& request("Year") &"-"& request("Month") &"-"& request("Day") &"' AND TimeID='"& rs("TimeID") &"'"
con.execute(mysql)
Any clues????