Insert Date and Time in SQL Server 2000 using ASP
am 27.02.2005 21:20:30 von Robin LawrieHi again, another problem!
I've moved from an Access database to SQL server and am now having trouble
inserting dates and times into seperate fields. I'm using ASP and the code
below to get the date and time, but my script is erroring.
'-- Get login date and time
cmdLoginDate = Date()
cmdLoginTime = Time()
'-- Insert into table
cmdDC1.CommandText = "INSERT INTO tblUserTracking (LoginDate, LoginTime,
Username) VALUES ('" & cmdLoginDate & "','" & cmdLoginTime & "','" &
cmdUsername & "') "
'-- Error message is:
The conversion of a char data type to a datetime data type resulted in an
out-of-range datetime value.
Can anyone help me fix this....I've looked on the web but all the articles
I've found explain why there are problems but I've not found anything that
helps me fix the problem.....
Thanks in advance....
Robin.