Jump to content
We've recently updated our Privacy Statement, available here ×

Using semi colon on SQL Query


henriquerr

Recommended Posts

I`m trying to use MySQL variable in Report Query but iReport accuses SQL syntax error.

To use MySQL variable I should put SET @varname := value;

Because of the semi colon I get a MySQL syntax error after the semi colon.

" You have an error in your SQL syntax; ... near 'SELECT DATE_ADD(.....)' "

Code:
SET @num := -1;SELECT     DATE_ADD('2009-08-24',INTERVAL @num := @num + 1 DAY) AS dayFROM     log
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...