🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1736

Re: Best way to set a date/time field

#1736
From: Steve Aletto
Date: Wed, 11 Feb 2004 08:05
25 lines
1915 bytes
Hi Viatcheslav,

thank you for the answer, I didn't know about parameters.

Anyway, I forgot to mention, I'm looking for an SQL statement to solve the
problem so that I can use it even when I don't use ADO.

So far, the only solution I found is substituting the comma if present in
the date/time field.

WRONG: UPDATE TableName SET FieldName1=1234,567, FieldName2='Hello'
                                          ^^^
CORRECT: UPDATE TableName SET FieldName1=1234.567, FieldName2='Hello'

Do you have any suggestion about this? Maybe treating that field as string
instead of double? I don't know, I think there could be problems that way as
well.

And how to handle different databases? I mean, with SQL server I must
substract 2.0 to the date/time field compared to Access. So I should use
different statements depending on the DB, is it correct?

Thanks.

Steve.
Technical Details
Message-ID: <4029e222@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <402905f6$1@newsgroups.borland.com> <402915e9$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,55d7527b38e6f972
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2004-02-11 00:09:38 PST
Reply-To: "Steve Aletto" <steve_alettoNOSPAM@THANKShotmail.com>
From: "Steve Aletto" <steve_alettoNOSPAM@THANKShotmail.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <402905f6$1@newsgroups.borland.com> <402915e9$1@newsgroups.borland.com>
Subject: Re: Best way to set a date/time field
Date: Wed, 11 Feb 2004 09:05:08 +0100
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 80.105.101.132
Message-ID: <4029e222@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1076486690 80.105.101.132 (11 Feb 2004 00:04:50 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail