theTechAlpha
theTechAlpha

Reputation: 17

I want to show a date from parameter in reports output

I want to display date parameter, in a standard report. I am trying like this : I have added a formula column like below:'

function P_DATEFormula return Date is
begin
  return to_date(:P_HIST_DATE ,'DD-MM-YYYY');
end;

This works in other reports but here does not appear in output.

Upvotes: 0

Views: 496

Answers (1)

Popeye
Popeye

Reputation: 35930

I must say that you are using a different function.

To display the date in the specified format in reports, You must use TO_CHAR function.

TO_DATE function just converts string to date and TO_CHAR converts it into the date to the specified string.

Date: By default, is displayed in the format specified in NLS parameter. If you want the date in some other format in reports TO_CHAR is the best option.

Like:

Select TO_CHAR(sysdate,'dd-mm-yyyyy') from dual;

Demo DB Fiddle for date formats

Cheers!!

Upvotes: 1

Related Questions