Date/Time stamp in SQL

G

Guest

I would like to store a Date/Time stamp in a SQL tabel
Now only the Date is stred and not the time. How to I get the time also

This is the code (There is more, but that works)

atSQLexe ex=new atSQLexe()
ex.addConnection=app.dbConnection
sql="INSERT INTO Log (UserID, Date) VALUES (@UserID, @Date)"
ex.addParm("@UserID",userID)
ex.addParm("@Date", DateTime.Today)
tr

ex.ExecuteSQL(sql)
}
 
W

Wardeaux

Bert,
if you have access to the table field definitions, you can set the default
value of the desired field to "getdate()", this retrieves the date/time on
the SQL server automatically, no need to specify manually...
hope this helps...
wardeaux
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top