Link
Link

Reputation: 171

Setting the value of prompt to current date

How do you possibly set the value of a prompt(date) to the current date when the user does not input any value? I always get invalid datatype error no matter what I do. :(

This is my prompt: enter image description here

Maybe my format is wrong but I have tried, NVL, setting default value on prompt settings and always get the same error.

Upvotes: 1

Views: 2553

Answers (3)

Ghulam Nabi
Ghulam Nabi

Reputation: 1

Use the expression "%Date" in the "Default Value" field; this will automatically populate the prompt with the current date when the query is run.

Upvotes: 0

Walucas
Walucas

Reputation: 2578

On the criteria, you should define an expression as a decode (since you are on oracle), like this:

EFFDT = DECODE(:3,' ', SYSDATE,:3)

Upvotes: 0

otherted
otherted

Reputation: 151

Try entering %Date as the default value.

It should populate the prompt with the current date when the query is executed. You will also need to uncheck the "optional" flag, as a prompt with a default value cannot be optional.

Upvotes: 0

Related Questions