>>Hi,
>>
>>I want to send to the SQL Server the following update command:
>>
>>
>>"update MyTable Set DateTimeColumn = " + TTOC(DateTime()) + " where Pk = " + nPk
>>
>>
>>The TTOC() does not seem to do the job as SQL Server returns an error. What would be the right syntax for sending the current Date and Time to update SQL Serrver column?
>>
>>TIA.
>
>I would suggest to go absolutely with parameters if you would send 'datetime()'. I wanted to note another point here:
>
>
>ltTime = datetime()
>SQLExec(m.lnHandle, 'update MyTable Set DateTimeColumn = ?m.ltTime where Pk = ?m.nPk')
>
>* vs
>
>SQLExec(m.lnHandle, 'update MyTable Set DateTimeColumn = getDate() where Pk = ?m.nPk')
>
are not the same thing and the latter use server's datetime. That may be a very important distinction depending on what you are doing.
>
>Cetin
Yes, you are correct. I realize the difference. Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham