Jump to content
Changes to the Jaspersoft community edition download ×

Using SQL Declare Function or alternatives?


richard.deans

Recommended Posts

I am a complete beginner with jaspersoft studio and desperately trying to get my head round the nuances of report writing and understanding this.

 

I am trying to create a number of reports with graphs within the studio so here is my dilemma and I am sure it's easy for those of you with knowledge to point me in the right direction.

 

All of my databases store data in strings, dates are stored as e.g. 20141209, normally I use SQL such as;

 

DECLARE @startdate CHAR(8)

DECLARE @finaldate CHAR(8)

 

SELECT @startdate=CONVERT(CHAR(8),GETDATE()-1,112),

@finaldate=CONVERT(CHAR(8),GETDATE(),112)

 

to return the previous days information requirements.

 

I have tried using this within the Jasperstudio SQL connector and it appears to ignore it.

 

I obviously do not want to re-write the queries daily with the date range(s) but have no idea how I could achieve the same results in studio.

 

 

Please help

 

 

Regards

 

R

 

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...