Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to change the default display of datetime

5 posts in General Discussion Last posting was on 2010-08-05 03:19:03.0Z
Yaniv C. Posted on 2010-08-04 17:43:22.0Z
Sender: f9e.4c59a5ab.1804289383@sybase.com
From: Yaniv C.
Newsgroups: sybase.public.ase.general
Subject: How to change the default display of datetime
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4c59a6ba.fc1.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 4 Aug 2010 10:43:22 -0700
X-Trace: forums-1-dub 1280943802 10.22.241.41 (4 Aug 2010 10:43:22 -0700)
X-Original-Trace: 4 Aug 2010 10:43:22 -0700, 10.22.241.41
Lines: 18
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:29446
Article PK: 78677

Hi

I am using Sybase ASE 15.0.3
Is there any server configuration, setting or any other
trick
to change the default display of datetime column to see it
in other format rather than ' Aug 2 2010 4:29PM' ?

For example '2010/08/02 16:29'

Of course without any convert(varchar..,column,106,108,..)

Black box application that do queries to log file and screen
and customer is not happy with datetime format...


Thanks,
Yaniv


Sherlock, Kevin [TeamSybase] Posted on 2010-08-04 18:25:17.0Z
From: "Sherlock, Kevin [TeamSybase]" <kevin.sherlock@teamsybase.com>
Newsgroups: sybase.public.ase.general
References: <4c59a6ba.fc1.1681692777@sybase.com>
Subject: Re: How to change the default display of datetime
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c59b08d$1@forums-1-dub>
Date: 4 Aug 2010 11:25:17 -0700
X-Trace: forums-1-dub 1280946317 10.22.241.152 (4 Aug 2010 11:25:17 -0700)
X-Original-Trace: 4 Aug 2010 11:25:17 -0700, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:29448
Article PK: 78679

datetime display formats are a "client" side issue. If you want your client
to default to a specific format, code your client that way. If you are
using someone else's client code (ie, "isql" for instance), you're choices
are limited.

I believe "sqsh" utility offers some datetime formatting display options,
but I can't remember how to do that at this time. You can also write a
simple perl query tool using CTlib or Sybase DBI/DBD libraries to control
display.

Aside from that, you would have to either write some views with the
necessary "convert" statements, etc.

Remember, every native datatype has a "default" display format. Datetimes
are no different, but you can only control that by changing it to a
"(var)char" datatype with convert/cast in your query. Same holds true with
character fields. If I want the trailing spaces eliminated from all char
fields, I would have to either convert them to varchar fields, or use rtrim
(which results in a varchar field), etc. If I want my negative numeric
numbers to have parenthesis around them without the minus "-" sign, convert
it to varchar(), if I want commas in my "money" datatypes, etc. It usually
all comes down to converting datatypes to (var)char types and controlling
the format via SQL.

Of course, if you are in control of the client code, all of this is doable
there as well.

<Yaniv C.> wrote in message news:4c59a6ba.fc1.1681692777@sybase.com...
> Hi
>
> I am using Sybase ASE 15.0.3
> Is there any server configuration, setting or any other
> trick
> to change the default display of datetime column to see it
> in other format rather than ' Aug 2 2010 4:29PM' ?
>
> For example '2010/08/02 16:29'
>
> Of course without any convert(varchar..,column,106,108,..)
>
> Black box application that do queries to log file and screen
> and customer is not happy with datetime format...
>
>
> Thanks,
> Yaniv


Yaniv C. Posted on 2010-08-04 18:54:09.0Z
Sender: 110e.4c59b6df.1804289383@sybase.com
From: Yaniv C.
Newsgroups: sybase.public.ase.general
Subject: Re: How to change the default display of datetime
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4c59b751.1119.1681692777@sybase.com>
References: <4c59b08d$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 4 Aug 2010 11:54:09 -0700
X-Trace: forums-1-dub 1280948049 10.22.241.41 (4 Aug 2010 11:54:09 -0700)
X-Original-Trace: 4 Aug 2010 11:54:09 -0700, 10.22.241.41
Lines: 67
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:29451
Article PK: 78683

Hi

Thanks for the answer.
As for client, of course. we need to use convert function.

Well,I my case, the client is someone else...
You mentioned something about "...you're choices are
limited..."
Do I have any choice?

Thanks,
Yaniv

> datetime display formats are a "client" side issue. If
> you want your client to default to a specific format,
> code your client that way. If you are using someone
> else's client code (ie, "isql" for instance), you're
> choices are limited.
>
> I believe "sqsh" utility offers some datetime formatting
> display options, but I can't remember how to do that at
> this time. You can also write a simple perl query tool
> using CTlib or Sybase DBI/DBD libraries to control
> display.
>
> Aside from that, you would have to either write some views
> with the necessary "convert" statements, etc.
>
> Remember, every native datatype has a "default" display
> format. Datetimes are no different, but you can only
> control that by changing it to a "(var)char" datatype
> with convert/cast in your query. Same holds true with
> character fields. If I want the trailing spaces
> eliminated from all char fields, I would have to either
> convert them to varchar fields, or use rtrim (which
> results in a varchar field), etc. If I want my negative
> numeric numbers to have parenthesis around them without
> the minus "-" sign, convert it to varchar(), if I want
> commas in my "money" datatypes, etc. It usually all
> comes down to converting datatypes to (var)char types and
> controlling the format via SQL.
>
> Of course, if you are in control of the client code, all
> of this is doable there as well.
>
> <Yaniv C.> wrote in message
> > news:4c59a6ba.fc1.1681692777@sybase.com... Hi
> >
> > I am using Sybase ASE 15.0.3
> > Is there any server configuration, setting or any other
> > trick
> > to change the default display of datetime column to see
> > it in other format rather than ' Aug 2 2010 4:29PM' ?
> >
> > For example '2010/08/02 16:29'
> >
> > Of course without any convert(varchar..,column,106,108
> ,..) >
> > Black box application that do queries to log file and
> > screen and customer is not happy with datetime format...
> >
> >
> > Thanks,
> > Yaniv
>
>


Sherlock, Kevin [TeamSybase] Posted on 2010-08-04 22:33:05.0Z
From: "Sherlock, Kevin [TeamSybase]" <kevin.sherlock@teamsybase.com>
Newsgroups: sybase.public.ase.general
References: <4c59b08d$1@forums-1-dub> <4c59b751.1119.1681692777@sybase.com>
Subject: Re: How to change the default display of datetime
Lines: 73
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4c59eaa1$1@forums-1-dub>
Date: 4 Aug 2010 15:33:05 -0700
X-Trace: forums-1-dub 1280961185 10.22.241.152 (4 Aug 2010 15:33:05 -0700)
X-Original-Trace: 4 Aug 2010 15:33:05 -0700, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:29452
Article PK: 78684

Yes. Create a view (or a stored procedure) that formats the data like you
want it, and tell them to report from the view/proc instead.

<Yaniv C.> wrote in message news:4c59b751.1119.1681692777@sybase.com...
> Hi
>
> Thanks for the answer.
> As for client, of course. we need to use convert function.
>
> Well,I my case, the client is someone else...
> You mentioned something about "...you're choices are
> limited..."
> Do I have any choice?
>
> Thanks,
> Yaniv
>
>
>> datetime display formats are a "client" side issue. If
>> you want your client to default to a specific format,
>> code your client that way. If you are using someone
>> else's client code (ie, "isql" for instance), you're
>> choices are limited.
>>
>> I believe "sqsh" utility offers some datetime formatting
>> display options, but I can't remember how to do that at
>> this time. You can also write a simple perl query tool
>> using CTlib or Sybase DBI/DBD libraries to control
>> display.
>>
>> Aside from that, you would have to either write some views
>> with the necessary "convert" statements, etc.
>>
>> Remember, every native datatype has a "default" display
>> format. Datetimes are no different, but you can only
>> control that by changing it to a "(var)char" datatype
>> with convert/cast in your query. Same holds true with
>> character fields. If I want the trailing spaces
>> eliminated from all char fields, I would have to either
>> convert them to varchar fields, or use rtrim (which
>> results in a varchar field), etc. If I want my negative
>> numeric numbers to have parenthesis around them without
>> the minus "-" sign, convert it to varchar(), if I want
>> commas in my "money" datatypes, etc. It usually all
>> comes down to converting datatypes to (var)char types and
>> controlling the format via SQL.
>>
>> Of course, if you are in control of the client code, all
>> of this is doable there as well.
>>
>> <Yaniv C.> wrote in message
>> > news:4c59a6ba.fc1.1681692777@sybase.com... Hi
>> >
>> > I am using Sybase ASE 15.0.3
>> > Is there any server configuration, setting or any other
>> > trick
>> > to change the default display of datetime column to see
>> > it in other format rather than ' Aug 2 2010 4:29PM' ?
>> >
>> > For example '2010/08/02 16:29'
>> >
>> > Of course without any convert(varchar..,column,106,108
>> ,..) >
>> > Black box application that do queries to log file and
>> > screen and customer is not happy with datetime format...
>> >
>> >
>> > Thanks,
>> > Yaniv
>>
>>


Yaniv C. Posted on 2010-08-05 03:19:03.0Z
Sender: 1100.4c59b620.1804289383@sybase.com
From: Yaniv C.
Newsgroups: sybase.public.ase.general
Subject: Re: How to change the default display of datetime
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4c5a2da7.508.1681692777@sybase.com>
References: <4c59eaa1$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 4 Aug 2010 20:19:03 -0700
X-Trace: forums-1-dub 1280978343 10.22.241.41 (4 Aug 2010 20:19:03 -0700)
X-Original-Trace: 4 Aug 2010 20:19:03 -0700, 10.22.241.41
Lines: 76
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:29453
Article PK: 78685

Thanks

> Yes. Create a view (or a stored procedure) that formats
> the data like you want it, and tell them to report from
> the view/proc instead.
>
> <Yaniv C.> wrote in message
> > news:4c59b751.1119.1681692777@sybase.com... Hi
> >
> > Thanks for the answer.
> > As for client, of course. we need to use convert
> function. >
> > Well,I my case, the client is someone else...
> > You mentioned something about "...you're choices are
> > limited..."
> > Do I have any choice?
> >
> > Thanks,
> > Yaniv
> >
> >
> >> datetime display formats are a "client" side issue. If
> >> you want your client to default to a specific format,
> >> code your client that way. If you are using someone
> >> else's client code (ie, "isql" for instance), you're
> >> choices are limited.
> >>
> >> I believe "sqsh" utility offers some datetime
> formatting >> display options, but I can't remember how
> to do that at >> this time. You can also write a simple
> perl query tool >> using CTlib or Sybase DBI/DBD libraries
> to control >> display.
> >>
> >> Aside from that, you would have to either write some
> views >> with the necessary "convert" statements, etc.
> >>
> >> Remember, every native datatype has a "default" display
> >> format. Datetimes are no different, but you can only
> >> control that by changing it to a "(var)char" datatype
> >> with convert/cast in your query. Same holds true with
> >> character fields. If I want the trailing spaces
> >> eliminated from all char fields, I would have to
> either >> convert them to varchar fields, or use rtrim
> (which >> results in a varchar field), etc. If I want my
> negative >> numeric numbers to have parenthesis around
> them without >> the minus "-" sign, convert it to
> varchar(), if I want >> commas in my "money" datatypes,
> etc. It usually all >> comes down to converting
> datatypes to (var)char types and >> controlling the
> format via SQL. >>
> >> Of course, if you are in control of the client code,
> all >> of this is doable there as well.
> >>
> >> <Yaniv C.> wrote in message
> >> > news:4c59a6ba.fc1.1681692777@sybase.com... Hi
> >> >
> >> > I am using Sybase ASE 15.0.3
> >> > Is there any server configuration, setting or any
> other >> > trick
> >> > to change the default display of datetime column to
> see >> > it in other format rather than ' Aug 2 2010
> 4:29PM' ? >> >
> >> > For example '2010/08/02 16:29'
> >> >
> >> > Of course without any convert(varchar..
> ,column,106,108 >> ,..) >
> >> > Black box application that do queries to log file and
> >> > screen and customer is not happy with datetime
> format... >> >
> >> >
> >> > Thanks,
> >> > Yaniv
> >>
> >>
>
>