Solved

Cognos 8 calculating with prompts

Posted on 2008-06-14
3
757 Views
Last Modified: 2010-04-29
Hi

I am creating a cognos report that uses date prompts, when you run the report you enter a start date and an end date. What i would like to do is make a calulation on the results of a query based on the number of months between the start and end dates entered for example

if the number of months between the start and end date entered is 12 I would like to multiply a query result by 12 and then Divide by 2 but if the number of months between the start and end date entered is only 1 I would just like to multiply by 12.

Can anyone make any suggestions please.

Adam
0
Comment
Question by:ac_davis2002
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
ibrusett earned 500 total points
ID: 21786398
I think this is a Cognos issue...
But anyway, you can use SQL server function inside cognos report, so try to create a calculated field on your two date paramenters using DATEDIFF:

DATEDIFF ( mm, startdate , enddate ) gives you the difference in months between the two dates.
Use this calculation to create an if statement to obtain the correct product!
0
 

Author Comment

by:ac_davis2002
ID: 21788107
EXCELLENT
THANKS!!!
0
 

Author Closing Comment

by:ac_davis2002
ID: 31467229
Thanks again
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question