Run Command Insert statement have syntax error

Syntax error in
“INSERT INTO [Contract,Price Master$] (Log Date) VALUES ('”+Today.ToString(“dd-MM-yyyy”)+“')”

Can anyone please solved it?

Note: specially for excel

Hi @nkdesai

Try this:

"INSERT INTO [Contract,Price Master$] ([Log Date]) VALUES ('" + Today.ToString("dd-MM-yyyy") + "')"

Hope it helps!!

1 Like

@nkdesai

"INSERT INTO [Contract,Price Master$] ([Log Date]) VALUES ('" & Date.Today.ToString("dd-MM-yyyy") & "')"

1 Like

Thank you @Parvathy for the solution

1 Like

Thank you @rlgandu for the solution

You’re welcome @nkdesai

Happy Automation!!

if Column name is like “Amendment / Revision #”, How we can define “#” in insert query ?

Hi @nkdesai

Try this once:

"INSERT INTO [Contract,Price Master$] ([Log Date], [Amendment / Revision #]) VALUES ('" + Today.ToString("dd-MM-yyyy") + "', 'YourValueHere')"

Hope it helps!!

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