Jump to content

specifying default date format/ value to Date


shraddha.s.mirashi

Recommended Posts

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
  • 5 years later...
 I can't find any way to do this directly, but here's a workaround:

1) First make the parameter's type String rather than Date.

2) Then enter a Default value expression for the date literal like this: "2018-01-23"

3) Finally, use something like the following, which might need to get adjusted for the type of SQL you're using:

  • For MariaDB (or MySQL) SQL use: STR_TO_DATE($P{From},"%Y-%m-%d"), where you need to first replace 'From' with the name of your actual parameter.

This allows you to easily edit the default value as a string, and then use it as a date type in your SQL.

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