COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: EArumugam on 06 Oct 2009 07:36:35 AM

Title: Macro
Post by: EArumugam on 06 Oct 2009 07:36:35 AM
I am using the following code
#prompt('fiscal','integer','year(getdate())')#  for making the current year as default selection in value prompt

but i am getting the below error..

RQP-DEF-0177
      An error occurred while performing operation 'sqlPrepareWithOptions' status='-9'.
UDA-SQL-0107 A general exception has occurred during the operation "prepare". ORA-00904: "YEAR": invalid identifier

it urgent , please clarify
Title: Re: Macro
Post by: david.stachon on 06 Oct 2009 10:05:10 AM
...looks like you are using Microsoft syntax to talk to an Oracle database..

try this instead:

your: year(getdate())

...will need to be something more like:

to_integer(to_char(sysdate(),'yyyy'))

(sorry, i don't have an oracle db to test against, but hopefully you get the idea)