Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-07-24 : 08:52:26
|
| Manoj writes "Hi Friends,How can I store Current date in a smalldatetime field using GETDATE() method. Through my code, it stores an unexpected date. I want to store current date & time in the table. Here is my codeI'm using SQL Server7SET @vCmd = 'UPDATE ' + @vTableName + ' SET locked = 0 , lockedby = ''' + @vUserName + ''', lastupdated = '+ CONVERT(CHAR(25),GETDATE(),103) + ' WHERE ' + @vFieldName +' IN (' + @vFieldValue +')'EXEC (@vCmd)While executing the code, SQL Server stores 1900-01-01 00:00:00 in the field.How can I store current datePls help.Thanks in advanceManoj" |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-07-24 : 09:12:45
|
| SET @vCmd = 'UPDATE ' + @vTableName + ' SET locked = 0 , lockedby = ''' + @vUserName + ''', lastupdated = '''+ CONVERT(CHAR(25),GETDATE(),103) + ''' WHERE ' + @vFieldName +' IN (' + @vFieldValue +')' EXEC (@vCmd)<O> |
 |
|
|
|
|
|