• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3529
  • Last Modified:

Get date range prompt date parts in Cognos.

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
Blowfelt82
Asked:
Blowfelt82
  • 5
  • 4
1 Solution
 
SNeupaneCommented:
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
 
Blowfelt82Author Commented:
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
 
Blowfelt82Author Commented:
Where does the 'between ... and ...' format come from.
0
Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

 
SNeupaneCommented:
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
 
Blowfelt82Author Commented:
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
 
SNeupaneCommented:
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
 
SNeupaneCommented:
Do not use 'range' for those date prompts.
0
 
SNeupaneCommented:
My comment #36497132 should resolve the issue.
I've tested it and works fine.
0
 
Blowfelt82Author Commented:
Sorry for the late response.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now