Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread CAST(datecol AS humanstyledate)
Wed, Aug 1 2007 7:56 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

I know its possible to extract the component parts of a date and build into a "normal" character string (eg dd/mm/yyyy) but can we have a simpler way to do it eg CAST(datecol AS humanstyledate). I'd be happy with it using the system date format or possibly an extension like

CAST(datecol AS CHAR(10) FORMAT 'dd/mm/yyyy')

The reason is I often want to join a date to a string field for display purposes - until now I've been doing it with calculated fields but I'm trying to use more sql and something like

IF(_Date IS NOT NULL,CAST(_Date AS CHAR(10))+ ' ','') +_Status + ': '+ _Stage AS _InProcess,

gives it in yyy-mm-dd format

Roy Lambert
Wed, Aug 1 2007 9:49 AMPermanent Link

"Jose Eduardo Helminsky"
Roy

It will be amazing if the FORMAT could be used by any data type (like a
mask). Even if it is non standard it will be a very good feature. Imagine
something like:

select cast(cod format '####0') as "Code", cast(dat format 'dd/mm/yyyy') as
"Date", cast(val format '##,##0.00') as Value from tablex order by 2 desc

Eduardo

Wed, Aug 1 2007 2:01 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I know its possible to extract the component parts of a date and build
into a "normal" character string (eg dd/mm/yyyy) but can we have a simpler
way to do it eg CAST(datecol AS humanstyledate). I'd be happy with it using
the system date format or possibly an extension like >>

I will add this to the list.   It most likely would end up being a keyword
extension to the CAST function.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image