i want to retrieve date from sql server not from system. so i use getdate function but it not working in vba here is code and error
conn.Execute "insert into dbo.Customers (AccountNo,Amount,code) values ('" & AccountNo & "', '" & Amount & "', '" & getdate() & "')"
You want getdate()
to be executed by SQL Server, not VBA. You have quotes in the wrong place around getdate()
:
conn.Execute "insert into dbo.Customers (AccountNo, Amount, code) values ('" & AccountNo & "', '" & Amount & "', getdate())"
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments