Cognos 10.2 - date range default earliest vs today - cognos-10

Very simple question (hopefully) but I can't find the answer anywhere. I have two seemingly identical date prompts for optional date ranges. One defaults to today's date. The other defaults to 'earliest' and 'latest'. But I can't for the life of me find the setting that controls this.
(I'm not trying to do anything advanced such as dynamical defaults, using javascript.)
Please help. Thanks.

A single-select date prompt with the Required property set to 'No' and the Range property set to 'Yes' will show the Earliest and Latest radio buttons and have them selected as default. When the Required property is set to 'Yes' the date prompts default to the current date. Thus, your two date prompts likely have different settings for the Required property.

Related

SSRS Report Builder: Default Value of Date Parameter Unresponsive

I have a report that has Period, From Date, and To Date parameters. The Period is the number of months that should be between the From Date and To Date parameters by default. The From Date defaults to the system date.
The functionality I need is that if someone should change the From Date or Period parameters, the To Date should update automatically to the correct value. I also need to allow all three parameters to be manually alterable by the end user.
The default for the From Date works fine.
So far I have tried the following:
Using an SSRS expression to set the To Date Default value. This works correctly when I put a value into the Period parameter, however when I change that value the To Date does not update.
Using a dataset to set the To Date Default value. This has the same result as (1).
Using a dataset to set the Default and Available values to the calculated value. This updates correctly, however it becomes a none interactive parameter.
Using a helper parameter, with Default and Available values set as (3), then using this parameter as the default for To Date. This works correctly, producing the functionality I want, but it leaves a none interactive parameter on the parameters list, which is aesthetically undesirable.
Doing as (4), but making the helper parameter hidden. This reverts to the same functionality as (1).
Doing as (4), but making the parameter internal. This reverts to the same functionality as (1).
All parameters are set to Always Refresh. I don't understand why hiding the parameter makes it work differently, and I've run out of ideas for how to do this. Any suggestions would be very much appreciated.

Issue with date checking

In Apex app I've a region called Person on a page. Inside a region there is a masked date picker. I have a task to validate the date of birth. So, the date of birth could not be less 1900 year. In "Conditions" section i'd been trying to write an pl/sql expression:
TRUNC(TO_DATE(:P1002_CONTR_BIRTH_DATE, 'MM-DD-YYYY')) > TO_DATE('01.01.1900', 'MM-DD-YYYY')
but it doesn't work. What am I doing wrong?
You put it to wrong place - "Condition" is used to decide whether an item will (or will not) be rendered on the screen.
Validation should be put into ... well, validation (obviously).
right-click the P1002_CONTR_BIRTH_DATE date picker item
choose "Create Validation"
set its type to "PL/SQL function (returning error text)
use such a code (presuming that you set the date picker format mask to MM-DD-YYYY):
if to_date(:P1002_CONTR_BIRTH_DATE, 'mm-dd-yyyy') < date '1900-01-01' then
return ('Error - can not set it to before 01-01-1900');
end if;
set it to fire when SUBMIT button is pressed
Alternatively (and way simpler) would be to open date picker item's property palette, navigate to its "Minimum date" property and put (for example) -120y in there which will allow dates that are higher than sysdate - 120 years (today, Apex would raise the
Birth date is less than specified minimum date 04-15-1898'
which isn't exactly "1900", but - you can easily calculate it, right? Also, -120y is somewhat more flexible than fixed year 1900.
Now you have two options, pick the one that suits you best.
TO_DATE() method is to convert a string to date, the string format should be the same as format_mask.
TRUNC(TO_DATE(:P1002_CONTR_BIRTH_DATE, 'MM-DD-YYYY')) > TO_DATE('01-01-1900', 'MM-DD-YYYY')
or
TRUNC(TO_DATE(:P1002_CONTR_BIRTH_DATE, 'MM-DD-YYYY')) > TO_DATE('01.01.1900', 'MM.DD.YYYY')
and also make sure :P1002_CONTR_BIRTH_DATE is also the same as format.
For detail

What is the difference between Flex mx:DateField disabledRanges = "" and selectableRange = ""?

I Want a flex date field with particular selectable range only.
I could there are similar properties of mx:DateField to restrict the selectable date range. that are
<mx:DateField disabledRanges="{[{rangeEnd: new Date()}]}"/>
and
<mx:DateField selectableRange="{{rangeStart : new Date()}}" y="100"/>
so i would like to know what is the difference between above two properties and in which case have to use disabledRanges and selectableRange.
disabledRanges allows you to define multiple date ranges to exclude from being selected.[1]
selectableRange allows you to define a single date range to include for selection.[2]
The difference is small but powerful, the ability to define multiple exclusions allows much more customisation.
Imagine you wanted to only allow someone to pick a date in this month, that easy with selectableRange, but imagine you also wanted to exclude all weekends and national holidays? You can't do that with one inclusive date range, you need multiple exclusions.
This properties are opposite. With disabledRanges you could disable some date (dates) from choosing (and other dates will be available to user) and with selectableRange you could set date (dates) that only available (and other dates will be disabled for user).
disabledRanges
selectableRange

Base one datetime filter on another datetime filter in SSRS Report Builder

I'm looking to either show an error message (fail) the report, if the end time filter is selected as being earlier than the start time filter, or disallow a user from selecting an end time that is before the currently selected start time.
Any ideas? I do not want to lose the pop up calendar functionality for the end time filter. I also don't want to set any kind of default value for the end time based on the start time.
I think Error message is your option.
I looked into this earlier, I couldn't find much on it. Can't really restrict what user can pick unless you want to put valid available dates into a dropdown. If you want the datepicker(popup calendar) and you don't want to set a default for end date based on startdate, then just let the user pick, check if #EndDate < #StartDate either in you query or in an expression of the item you choose to display your message to the user.
Hope it helps

Disable dates outside a range in Infragistics WebMonthCalendar control

I want to disable dates which are not in between RangeMin and RangeMax from a selectedDates collection in an Infragistics WebMonthCalendar control, I have researched a bit but not found any clue.
Which WebMonthCalendar property should I have use?
In the WebMonthCalendar, you have two properties named MinDate and MaxDate.
They get or set the maximum and minimum date that can be selected in the calendar.
I don't know it they disable the dates outside their values, please check if this could be your answer.

Resources