Date/Time stamp in SQL

  • Thread starter Thread starter Guest
  • Start date Start date
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)
}
 
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
 
Back
Top