Use pattern to format Date and DateTime in Framework Manager or Report Studio

Technote (troubleshooting)


Problem(Abstract)

Unable to set a Date and DateTime pattern in Report Studio or Framework Manager.


Error Meaasge:

I18-FMT-0012 An error occurred while applying the format pattern. The specified localized pattern is invalid.

Cause

This error occurs when a format pattern entry is specified that is incorrect. For example, if the value of yyyy/dd/MM hh:mm:ss bb is set as the pattern the above error will be returned because the bb pattern value is invalid.

Resolving the problem

It is possible to specify an explicit format for Query Items in Framework Manager. This example will use the Date and DateTime format settings.

To change a displayed format for a Date or DateTime query item, select the item, then Properties, Format and "Click to Edit"

The Data Format selection will open with all the options of changing the display format of the query item.

Note that the Pattern option will overrule some of the settings that might have been selected previously.

For instance, selecting the date to display AM/PM symbols and Two Digit Hours, Minutes and Seconds, and at the same time specifying a pattern as "MM/dd/yyyy" , will not return the AM/PM and Hours, Minutes, Seconds part. The pattern will only return the Month/Day/Year specified as pattern in that case.

For instance to have the date display as "2003/31/01 23:56:02 PM" the following pattern needs to be used : "yyyy/dd/MM hh:mm:ss aa".

The case of letters used in pattern matters. For years, both y and Y are the same. For months, "MMM" is short name of month. "MMMM" is the full name of month. "mmm" displays month in numeric format. For days, "d" is the day of the month. "D" is the day of the year. "yyyy-MMM-dd" displays 2004-Sep-20.

The following presents a short table on the external standard for representation of the various items.

For a complete reference of supported symbols in Cognos 8, please use the Cognos 8 Framework Manager User Guide: Appendix D: Using Patterns to Format Data.

For a complete reference of supported symbols in IBM Cognos ReportNet, please use the Cognos ReportNet Report Studio User Guide: Appendix G: Using Patterns to Format Data

Symbol

Meaning

Presentation

Example

G

era designator

Text

AD

y

year

Number

1999

M

month in year

Text & Number

July & 07

d

day in month

Number

31

h

hour in am/pm (1-12)

Number

12

H

hour in day (0-23)

Number

0

m

minute in hour

Number

30

s

second in minute

Number

55

S

millisecond

Number

978

E

day in week

Text

Tuesday

D

day in year

Number

189

F

day of week in month

Number

2 (2nd Wed in July)

w

week in year

Number

27

W

week in month

Number

2

a

am/pm marker

Text

PM

k

hour in day (1-24)

Number

24

K

hour in am/pm (0-11)

Number

0

z

time zone

Text

Pacific Standard Time




RELATED DOCUMENTS

Cognos 8 Framework Manager User Guide: Appendix D: Using Patterns to Format Data.

Cognos ReportNet Report Studio User Guide: Appendix G: Using Patterns to Format Data.

Cross Reference information
Segment Product Component Platform Version Edition
Business Analytics Cognos 8 Business Intelligence Framework Manager
Business Analytics Cognos 8 Business Intelligence Install and Config
Business Analytics Cognos 8 Business Intelligence Report Studio
Business Analytics Cognos ReportNet ReportNet

Historical Number

1026374

Rate this page:

(0 users)Average rating

Document information


More support for:

Cognos 8 Business Intelligence
Cognos Connection

Software version:

1.1, 8.1, 8.2

Operating system(s):

Solaris, Windows

Reference #:

1340901

Modified date:

2008-01-04

Translate my page

Machine Translation

Content navigation