If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Char Field with Date. Need a Date Range.

Started by Cynthia, 25 Jan 2012 11:44:16 AM

Previous topic - Next topic

Cynthia

I have a Sybase Database table.

The field is defined as a Char in Sybase IQ. 
The field I need may have a date in it, or it may have the text 'mm/dd/yyyy'.

I need Cognos to do a date range function on this field (find out how many months between) for the ones that do have a valid date. But since it's defined as a Char and it may have a char in it.. I'm not sure what I can do?

Is there something maybe in the framework... if it's a 'mm/dd/yyyy' put in a blank or a number... but Framework Manager doesn't seem to want to do that, either, with an if then else, as the data types are different.

Anyway I'd love help thanks!

Lynn

Quote from: Cynthia on 25 Jan 2012 11:44:16 AM
The field is defined as a Char in Sybase IQ. 
The field I need may have a date in it, or it may have the text 'mm/dd/yyyy'.

I'm not sure what you mean by this. The data type is either character or date but can't be both, right? Perhaps the format of what is stored varies?

There are ways to convert the data. I have a similar situation where dates are stored as numbers. In my model I publish the numeric field as well as an additional field that casts the number to a true date datatype. In some cases I need validation to deal with bogus values (for example, zero is not a valid date but appears in my data).

Understanding what your data looks like would help people give a better answer.