?
Solved

Get date range prompt date parts in Cognos.

Posted on 2011-09-07
10
Medium Priority
?
3,236 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

 
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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
How to use Variables  and Custom code in SSRS report and Assembly reference to use compile shared code in SSRS. Its big question for all who are working with SSRS. It is easy to create assembly and refer in SSRS report, still there are some steps…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

762 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