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

Extract Date from datetime column

Started by Kalyan cognoise, 20 May 2009 05:40:06 AM

Previous topic - Next topic

Kalyan cognoise

Can you please tell me how to extract date from datetime? Example Currently from database date is coming  like this-- Jan 3 2002 9:12:34:566AM and i want to extract date part from that. Date should be like  Jan 03, 2002.Actually I want to use this in value prompt not at report level.

Gopinath


Kalyan cognoise

Hi Gopinath,

I have already tried this. It is giving me m/d/yyyy not Mon/dd/yyyy

Kalyan

ajaju

Hi,

Try using date(DateTime field) function.
It will give you result in Mon dd,yyyy format.
HTH!


Gopinath

try using

to_date()
or
to_char()

functions.

Gollapudi

HI,

First of all I would like to mention one thing i.e. we use CAST function to Covert the DATA TYPE not the date... You can use extract(datepart, Datetime_exp)
and coming to to_date() or to_char() functions, If the data base is Oracle then only you can use to_date() or to_char() functions, otherwise you will have to do this in Cognos Report Studio Level by using Vendor specific Functions [if avaialable] or Cognos Functions like extract

Gollapudi.