Solved

Get date range prompt date parts in Cognos.

Posted on 2011-09-07
10
2,484 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Time Corrections for Reports Working with a report, we made some interesting discoveries about the time corrections/updates We are using the following Parameters: Starting Entered Date (Date) formatted as Data type: "Date/Time" Ending Entered …
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

760 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

19 Experts available now in Live!

Get 1:1 Help Now