Solved

Get date range prompt date parts in Cognos.

Posted on 2011-09-07
10
2,792 Views
Last Modified: 2012-05-12
I have a prompt page in my Cognos report that only has a date range prompt, this date range is assigned to a varible which I am writing to a label in my actual report. This date range is formatted as...

'Between 6 Sep 2011 and 9 Sep 2011'

This is fine, but what I need is to be able to get the start date i.e. '6 Sep 2011' and '9 Sep 2011' as seperate variables. Do you have any ideas?
0
Comment
Question by:Blowfelt82
  • 5
  • 4
10 Comments
 
LVL 8

Expert Comment

by:SNeupane
ID: 36496904
Easiest method is, instead of a date range, use two date prompts:
StartDate
EndDate
Use the two date prompts in filter using between ?StartDate? and ?EndDate?
Then you can format them in your report accordingly.
0
 

Author Comment

by:Blowfelt82
ID: 36496944
Yeah I thought along these lines, but I was hoping that there would be another way which kept the existing prompt format. This change will have to be applied across a number of reports, so would like a change that wont change the apperance of the reports - my users are very fussy about changes like this. Can the solution I described be acheived... it doesnt matter how complex (within reason) but I really dont want to change the appearance of exisiting forms.
0
 

Author Comment

by:Blowfelt82
ID: 36496950
Where does the 'between ... and ...' format come from.
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 8

Expert Comment

by:SNeupane
ID: 36497063
How are you filtering the date in your report with in_range?
When you have in range, you only have one variable to filter the report date.
Since you need 2 variables for start and end, you have to replace that in range filter in the report with between ... and filter to include both prompt variables.
Check the query for report and look at the filters.
0
 

Author Comment

by:Blowfelt82
ID: 36497101
I am testing this using a very basic report, all I have done is added a date prompt to the report prompt page, set its attribute to range and set the parameter attribute to 'test'. Then in the report I have added a text item, set the source type to report expression and then used 'ParamDisplayValue('test') to output the date.

This is just a test, all I want to do is get the date parts for both display at the moment.
0
 
LVL 8

Accepted Solution

by:
SNeupane earned 500 total points
ID: 36497132
Start from scratch.
Add a prompt page.
Drag a Date prompt to the prompt page and name the parameter Start.
Drag another Date prompt and name End.

Go to report query and add a filter on your date item if you want to filter report on the selected dates:
[Date] between ?Start? and ?End?

In report, you can bring ParamDisplayvalue of those parameters and then format the values anyway you want using data format in the properties.
0
 
LVL 8

Expert Comment

by:SNeupane
ID: 36497159
Do not use 'range' for those date prompts.
0
 
LVL 8

Expert Comment

by:SNeupane
ID: 36904124
My comment #36497132 should resolve the issue.
I've tested it and works fine.
0
 

Author Closing Comment

by:Blowfelt82
ID: 36909291
Sorry for the late response.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
Introduction As you'll probably know, a data region in a SQL Server Reporting Services report can be linked to only one dataset.  This makes it troublesome when you need to display data from more than one dataset in the same data region.  SQL Serve…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

790 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