Forums

This topic is locked

Date() sql

Posted 18 Sep 2004 14:30:07
1
has voted
18 Sep 2004 14:30:07 shaun carter posted:
I have read the article on dmx.com ref the sql date entry, It says that if an SQL database if being used then it's easy to use the fields default value as date() to produce a date, I have tried this many times but can't get it to work, what should the fields data type be please. Any other pointers here would help too as I have 2 similar forms going to seperate tables, and a hidden field works on one but not the other, the value is <%=Date%>, when the one that fails fails to load the last part of the URL is ?upload=true..

Replies

Replied 20 Sep 2004 12:01:47
20 Sep 2004 12:01:47 Lee Diggins replied:
Hi Shaun

To get the current data in SQl use the getDate() function, which you can apply to the field as a default value for all inserts in SQL Enterprise Manager, set the field datatype to datetime.

Is this what you're after?

Digga

Sharing Knowledge Saves Valuable Time!!!
Replied 06 Oct 2004 17:11:33
06 Oct 2004 17:11:33 Rudy Limeback replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>It says that if an SQL database if being used ...<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>that sorta depends on which SQL database is being used

if it's SQL Server, use getdate()

if it's MySQL, use current_date

if it's Access, use date()

and so on

rudy
r937.com/

Reply to this topic