Jump to content
Changes to the Jaspersoft community edition download ×

SQL queries supporting java function?


ktrinad

Recommended Posts

By: huey miin - khmiin

SQL queries supporting java function?

2003-10-12 10:15

how to write a proper sql statement:

select * from studentMaster where registerDate <= $P{date}

 

registerDate column in the database is in STRING type but the date parameter pass in is DATE type. So how can i include java function to convert the STRING type to DATE type in the sql queries?

 

i found out the following syntax cannot work:

select * from studentMaster where (new SimpleDateFormat("MM/dd/yyyy").format(registerDate)) <= $P{date}

 

 

 

 

By: Mark Rhodes - mrhodes2

RE: SQL queries supporting java function?

2003-10-17 11:45

select * from studentMaster where registerDate <= convert(varchar(12,$P{date},101)

 

You have to use valid SQL functions in the query.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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