Forums
This topic is locked
Stupid Question?
Posted 13 Dec 2002 07:57:32
1
has voted
13 Dec 2002 07:57:32 John Stanford posted:
I know this may sound stupid, but ...What is the code for inserting today's date into a SQL DB from an ASP VBSript insert form?
ie: <%=Date()%>
Thanks,
Replies
Replied 13 Dec 2002 09:36:22
13 Dec 2002 09:36:22 Vince Baker replied:
<%=Date%> for just the date or <%=Now%> for date and time
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 13 Dec 2002 16:23:24
13 Dec 2002 16:23:24 Owen Eastwick replied:
Alternatively, don't insert the date at all, instead insert all the fields but the date and let SQL Server generate the date automatically.
Make the default value of the date field <b>getdate()</b>, this will generate the current date each time a new record is added to the table.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Make the default value of the date field <b>getdate()</b>, this will generate the current date each time a new record is added to the table.
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo