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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top