Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Prompts in Impromptu 7.1 1

Status
Not open for further replies.

navshiv

MIS
Feb 15, 2002
91
US
I am having a play in Impromptu 7.1 having gotten to know 6.1 very well. When I put in a prompt into a report as a type-in date the default puts in todays date in the format YYYY-MM-DD and when the prompt comes up when running the report it also comes up as YYYY-MM-DD.

In 6.1 even though the default came up as YYYY-MM-DD in the Prompt Manager it would come up as DD/MM/YYYY in the report.

Anyone got any ideas how I can change 7.1 to display as DD/MM/YYYY.

Thanks
 
What are your format date settings in:
Tools, Options, Data Format, Date ?

What are your format date settings in the cell of the .imr?
Right click, Format, Data ? Prompt format?

Maybe you want either of these to be changed?

If they are both General, then the format of the Database is creating a format of what type?

Note: Changing the first choice, will change format for all reports. If this is not what you want, then don't change it from General. It is common practice to leave this as General and change the date formats in your reporting only.


CP [cook]
 
Dates are set to General in Impromptu (tool settings and report format). I have tried changing these to dd/mm/yyyy but this does nothing to the prompt.

At the source the field is defined as date/time (dd/mm/yyyy hh:mm:ss)
 
navshiv,

Just change the format of the Prompt within the report to dd/mm/yy by clicking in the format mask shown and removing the time portion hh:mm:ss. This will not change the appearance of the prompt in the prompt dialog, but it will change the display of the prompt when it appears in the report. This is basically what CP was referring to above.

Hope this helps,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Sorry things aren't quite clear. When I mean at the source level the date is dd/mm/yyyy hh:mm:ss, I mean that this is the layout within the database (MS Access).

Where are you saying that I should change the date format? And where is this format mask? The formats in Impromptu are both on General (Tool settings and the format of the data in a report) and I have tried changing both of these and creating the report but still no luck. How do I change the format of the prompt?

I have also just noticed that the date that is coming in straight from the database has a 2 digit year where it is actually stored with 4 digits. Any idea why it is only showing 2 digits? In the configuration manager the input locale is eng_gbr.1252. My regional settings on the PC I am using all use 4 digit years so I am a bit lost where it is picking up this formatting!
 
navshiv,

A little clarification. When you insert a prompt into a report, you don't have the option to format it (through ver 7 at least, don't know about 7.1). You can, however, create a calculated column in the report and make it equal to the prompt. When you insert this calculated column in the report, you have the option to format it as described, just as if it was any other database column.

Hope this clarifies it a bit.

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
In your .imr you have the prompt Definition dialog box and that shows the Data type drop down box. After chosing the "date" type, then the Default value: will show a format type. That type cannot be changed "in most cases", but it should show you that the format you are getting for the prompt will look like that. If this is not what you want, then you need to change your expression for your data item to be the date format you want by using your favorite function.

CP [cook]
 
The thing that confuses me is that in Version 6 I do not get this problem. In the Prompt Mangager box, when I select the data type as date the example or default is in the format YYYY-MM-DD but when I run the report the prompt asks me for the date in the format DD/MM/YYYY which is correct.

I run the same report in v7 (copy of report anyway) the prompt comes up as YYYY-MM-DD.

The report in v6 displays the date in the correct format on the page with a 4 digit year but in v7 it only displays 2.

I have checked all the settings on my local PC and also in Config management but no luck. I would have thought there would be an .ini file which stored all of the format settings?

 
If your Impromptu.ini file shows this:

[Data Attributes]
numeric format=General
date format=General
time format=General
date time format=General
string format=General


Then, your format is coming from your data source. I do not understand how you would get a different format in 6.0 vs. 7.0 if you have these settings in both versions of ini files, and your report settings are the same. Ya got me there. Hope you find the answer. If you do, post it here, I would like to know what happened. This one is making my head spin.
[spin]



CP [cook]
 
Well I contacted Cognos about this and they told me that this was originally a bug in v7 but is now the 'design'!! (although it is still being looked at)

I now have to muck around using a calculated field as a workaround that they suggested.

Create a type in prompt of type string with a default as dd/mm/yyyy (called 'date' in this example).

Then create a calculated field number-to-date(string-to-integer(right(?date?, 4) + left(right(?date?, 7),2)+left(?date?,2)))

You use this new field in the filter which acts as the prompt.

Simple huh?!
 
When I mentioned: "you need to change your expression for your data item to be the date format you want by using your favorite function." I thought you may have to do a calculated field workaround. Thanks for the post. I am no longer spinning.[wink]

CP [cook]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top