Home » Developer & Programmer » Reports & Discoverer » returning value date from formula
returning value date from formula [message #635342] Fri, 27 March 2015 03:47 Go to next message
mikrimouse1
Messages: 4
Registered: March 2015
Junior Member
function lastdayinmonthFormula return Number is
begin
last_day(to_date(to_char('01'||lpad(:month,2,'0')||:year),'ddmmyyyy'))
end;

Now i dont know how to return this last day, I enter month and year in param form and i after i run report i get error , how do I return value from last_day ?
Thanks
Re: returning value date from formula [message #635343 is a reply to message #635342] Fri, 27 March 2015 03:51 Go to previous messageGo to next message
Littlefoot
Messages: 21575
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You need to return it, literally.

begin
  return last_day ...;
end;
Re: returning value date from formula [message #635344 is a reply to message #635343] Fri, 27 March 2015 03:53 Go to previous messageGo to next message
mikrimouse1
Messages: 4
Registered: March 2015
Junior Member
it doesnt work like that i tried
return last_day(to_date(to_char('01'||lpad(:mjesec,2,'0')||:par),'ddmmyyyy'));
and i get error expression is of wrong type

[Updated on: Fri, 27 March 2015 03:57]

Report message to a moderator

Re: returning value date from formula [message #635345 is a reply to message #635343] Fri, 27 March 2015 03:56 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
Also you'll need to fix the return type, last_day gives a date not a number.
Re: returning value date from formula [message #635346 is a reply to message #635344] Fri, 27 March 2015 03:57 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
mikrimouse1 wrote on Fri, 27 March 2015 08:53
it doesnt work like that i tried
return last_day(to_date(to_char('01'||lpad(:mjesec,2,'0')||:par),'ddmmyyyy'))
and i get error encountered the symbol END when exepting ..


Missing semi-colon
Re: returning value date from formula [message #635347 is a reply to message #635345] Fri, 27 March 2015 04:03 Go to previous message
mikrimouse1
Messages: 4
Registered: March 2015
Junior Member
Stupid me, thats correct , function return date not number
Previous Topic: show all values instead of null or as field type.
Next Topic: 2D barcode in report
Goto Forum:
  


Current Time: Fri Jul 10 04:51:29 CDT 2020