How to insert datetime in sql query by now.tostring

how insert datetime using now.tostring for sql
DB datetime - dataType

" UPDATE [DBl].[dbo].[CompanySummary] SET [Attempts] = [Attempts]+1, [Status] = ‘Y’ ,[Attachment_Validated_status] =‘Y’ , [AttachementValidated_Date_time] =(convert(datetime,’"+now.ToShortTimeString+",5)) [Rejected_Reason] = ‘null’ WHERE [Year] =’"+now.tostring(“yyyy”)
giving and datetime to string error

[AttachementValidated_Date_time] - datetime datatype
[Year] -datetime datatype

[AttachementValidated_Date_time ] = Format(GETDATE(),‘yyyy-MM-dd’)
Can you try the above

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.