I'm a newbie to Cognos 8.4/ReportNet and am writing my first Cognos report using Report Studio in an educational environment. In the following scenarion, I would like to only show records where [School year], a Date/Time field, is equal to the following:
[Program Participation].[Program Codes].[School Year]='Jun 30, 2006 12:00:00 AM'
I get an SQL error but I'm not sure how to make the comparison and only show records with the above date. Thanks for any help/suggestions.
Sheldon Potolsky
Hi,
You're trying to compare a date/time field to a string. You can't use single quotes around dates.
If you're not interested in the time portion try something like the following;
trunc([Program Participation].[Program Codes].[School Year]) = 2006-06-30
Nuffsaid.
Thanks. Since I was mainly interested in the year, the following seemed to work:
to_char([Program Participation].[Program Participation].[School Year],'yyyy') = '2010'
Sheldon