Article View: borland.public.interbase.sql
Article #798Re: Store datetime field as String
From: Craig Cookesley
Date: Wed, 09 May 2007 02:13
Date: Wed, 09 May 2007 02:13
35 lines
1892 bytes
1892 bytes
Thanks Wayne That worked, except I get the date as DD-MMM-YY when I would like DD/MM/YY ie 9- MAY-20 TO 09/05/07 Is this possible? Thanks again "Wayne Niddery [TeamB]" <wniddery@chaffaci.on.ca> wrote in message news:464088c2@newsgroups.borland.com... > Craig Cookesley wrote: >> >> I need to update a field defined as varchar(8) with a datetime field >> in a trigger >> >> The field is used extensive in code so to change the field type would >> be a big job >> >> i was hoping to cast or convert the datatime field to string before >> update > > Use cast. > > Update table set somefield = cast(current_date as varchar(8)) where > <condition> > > > -- > Wayne Niddery - Winwright, Inc (www.winwright.ca) > "Some see private enterprise as a predatory target to be shot, others > as a cow to be milked, but few are those who see it as a sturdy horse > pulling the wagon." - Winston Churchill >
Technical Details
Message-ID:
<46412e4d@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4640605c@newsgroups.borland.com> <464088c2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,d8456dd5bcafd5a4 X-Google-Attributes: gid114a0e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Craig Cookesley" <ccc@planet.net.au> Newsgroups: borland.public.interbase.sql References: <4640605c@newsgroups.borland.com> <464088c2@newsgroups.borland.com> Subject: Re: Store datetime field as String Date: Wed, 9 May 2007 12:13:35 +1000 Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 NNTP-Posting-Host: 203.214.87.79 Message-ID: <46412e4d@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1178676813 203.214.87.79 (8 May 2007 19:13:33 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail