COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Manu0521 on 07 Mar 2014 08:41:45 AM

Title: Error when trying to use date functions
Post by: Manu0521 on 07 Mar 2014 08:41:45 AM
Hi All,

I am trying to use the date functions to get the current year in my data item and I get this error when I validate my data item
CURRENT_DATE(), Sysdate() ,Year(date)...etc..  and my source data for the report is package published through TM1.

RSV-VAL -0010 Failed to Load the report specification XQE-CON-0007 XQE error encountered :XTM-CON -0001. An attempt to login to the TM1 server failed. The TM1 error code is : SystemServerNot Found. The TM1 error message is : SystemServerNotFound. Admin host :null Server Name : Null

And if I use Current_date instead of current_date() it returns me the date with out error . Can anyone explain me what is the problem.

Thanks,
Title: Re: Error when trying to use date functions
Post by: MFGF on 07 Mar 2014 09:13:58 AM
Hi,

If I was doing this, I would use the extract() function to extract the year from the current date, ie:

extract(year, current_date)

Does this give you the result you need?

MF.
Title: Re: Error when trying to use date functions
Post by: Manu0521 on 07 Mar 2014 02:42:43 PM
Yes, that gives me the result, but wanted to know why I am not able to use other date functions.
Thanks,
Title: Re: Error when trying to use date functions
Post by: bi4u2 on 10 Mar 2014 09:59:26 AM
Because current_date is a Cognos function while the other ones are database specific. TM1 is not Oracle or SQL so you would get an error.
Title: Re: Error when trying to use date functions
Post by: karthik12345 on 06 Jan 2016 08:15:26 AM
i am facing same problem if we want month in string format(i.e jan) how can i get that
if i use extract(month,current_date),iam getting '1' but instead of 1 i want to show 'jan'
how can i get this?

Thanks,
Karthee
Title: Re: Error when trying to use date functions
Post by: BigChris on 06 Jan 2016 08:46:11 AM
This might help:

http://cognostips.weebly.com/blog/month-name (http://cognostips.weebly.com/blog/month-name)
Title: Re: Error when trying to use date functions
Post by: karthik12345 on 06 Jan 2016 08:54:18 AM
thanks BigChris,
   But it also showing same error.

Thanks,
Karthee
Title: Re: Error when trying to use date functions
Post by: BigChris on 06 Jan 2016 09:32:37 AM
Hi Karthee,

What error are you you getting? Did you see Manu0521's comment:

QuoteAnd if I use Current_date instead of current_date() it returns me the date with out error