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.
use
cast([datetime field];Date)
Hi Gopinath,
I have already tried this. It is giving me m/d/yyyy not Mon/dd/yyyy
Kalyan
Hi,
Try using date(DateTime field) function.
It will give you result in Mon dd,yyyy format.
HTH!
try using
to_date()
or
to_char()
functions.
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.