Jump to content
Changes to the Jaspersoft community edition download ×

sql sum prev month - hot!


mda1234

Recommended Posts

Hello dear community, I have a huge problem that I have already spent a lot of time and effort, the computer with the jasperserver server is on site without remote access and where there is no internet. To try some version I have to go to the server ...

I need to form a simple SQL query:

It is necessary to summarize some values for the previous month.

In the usual sql I would do as and everywhere recommend

SELECT SUM(`test1`) FROM `test` WHERE   
`datetime` > LAST_DAY( DATE_SUB( CURDATE( ) , INTERVAL 2 MONTH ) ) + INTERVAL 1 DAY   
AND  `datetime` < DATE_ADD( LAST_DAY( CURDATE( ) - INTERVAL 1 MONTH ) , INTERVAL 1 DAY ) 

But this syntax does not work. How to make this in JasperSoft studio 6.0.1?

Link to comment
Share on other sites

  • Replies 1
  • 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...