Jump to content

problem with passing parameter


maalto

Recommended Posts

Hi,

I seem to have a slight problem with passing a parameter into the report.

SQL:

OR030100."OR03019" between '1/1/2007' AND $P{end_date}

 

parameters: end_date, java.util.Date, new Date(7,11,31)

 

-reults to empty report.

If I use a empty datasource I can print the parameter as: 12/31/07 12:00 AM

 

If I use as parameter new Date(), or choose via prompt I can get correct result.

 

What am I missing here ?

Please help.

 

Thanks, Mike

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi thanks for ansver,

I did it like this:

new SimpleDateFormat("yyyy-MM-dd").format(new Date())

 

-M$-sql server 2000 seems to like it that way.

 

And when I define last day of this month I did the following:

new SimpleDateFormat("yyyy-MM-dd").format(new Date(new Date().getYear(),new Date().getMonth()+1,0))

 

I don't know if that is the smartest/best way, but it seems to work.

 

BR. Mike

Link to comment
Share on other sites

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