Solved

Cognos 8 calculating with prompts

Posted on 2008-06-14
3
750 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
How to increase the row limit in Jasper Server.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now