🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #795

Re: Store datetime field as String

#795
From: Wayne Niddery [TeamB]
Date: Tue, 08 May 2007 14:27
22 lines
1626 bytes
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: <464088c2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4640605c@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
Reply-To: "Wayne Niddery [TeamB]" <wniddery@chaffaci.on.ca>
From: "Wayne Niddery [TeamB]" <wniddery@chaffaci.on.ca>
Newsgroups: borland.public.interbase.sql
References: <4640605c@newsgroups.borland.com>
Subject: Re: Store datetime field as String
Date: Tue, 8 May 2007 10:27:14 -0400
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 69.17.170.228
Message-ID: <464088c2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1178634434 69.17.170.228 (8 May 2007 07:27:14 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail