COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sspk on 28 Feb 2008 08:00:25 AM

Title: Report
Post by: sspk on 28 Feb 2008 08:00:25 AM
Hi All,
Can we use our own sql statement(some thing like the below one) in the RS.If we can please let me know how to do it.
select p.periodname
from ta.period_table p,
(select add_months(max(data_month_date), -23) From_Date, max(data_month_date) To_Date
from prescriber.current_data_month) t
where (p.startdate between t.From_Date and t.To_Date) or (p.enddate between t.From_Date and t.To_Date)
order by p.periodname
Title: Re: Report
Post by: Suraj on 28 Feb 2008 09:16:21 AM
What error message are you getting?
Title: Re: Report
Post by: sspk on 28 Feb 2008 09:47:29 AM
Quote from: Suraj Neupane on 28 Feb 2008 09:16:21 AM
What error message are you getting?
HI
I am doing in this manner,i already had a list report and now i am trying to link a SQL (in the query explorer)to the Query1.
in the properties ---SQL
sql syntax--->pass-through
data source--->Tods
Sql--> i am writing the above code
and i am validating it ,it is validating and if enter ok button it is  giving me the following error
query data items are not updated
you must your data item expressions manually
Title: Re: Report
Post by: Suraj on 28 Feb 2008 11:06:12 AM
That's not an error.
That's just telling that it doesn't validate manually entered SQL.
run the report and see if you get an error message.