MySQL Forums
Forum List  »  Connector/ODBC

SQL Set Statements and ODBC
Posted by: Nick Fugal
Date: May 31, 2016 11:20AM

Hello,

I have created a SQL query in MySQL workbench which uses a SET statement to update numerous parts of the query with a specific date. The statement is :

SET @MaxDate = '2016-04-30';

Whenever I run the query, all I have to do is change the month end date. I tried to use this same query in excel using an ODBC connection to my data base but get a syntax error. If I remove the Set statement in the ODBC SQL statement within excel, the query will run without the error.

I would like to be able to use an ODBC connection to pull month end information from my database by only updating the date one time in my query.

Please help.

Options: ReplyQuote


Subject
Written By
Posted
SQL Set Statements and ODBC
May 31, 2016 11:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.