🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.vdbase.data.sql
Article #162

Re: Date field in sql builder

#162
From: Steve Koterski
Date: Fri, 05 Mar 1999 00:00
39 lines
2331 bytes
On Thu, 4 Mar 1999 10:24:06 +0100, teamb@opto-pps.com (Romain Strieff
[TeamB]) wrote:

[...]

>But only if you use the slash as separator, if you use the dot, it works. 
>It seems to think it's US dates only when it sees the "/"

Holy sheep doo-doo, Batman! You are correct and I have empirically
confirmed this behavior (which satisfies my penchant for cynical doubt --
no offense intended).

With a Windows setting for Short Date Style of dd.MM.yyyy and a Date
Separator setting of a period (.), local SQL will indeed accept DATE and
TIMESTAMP literals where the date is in this format.

  SELECT OrderNo, SaleDate, EXTRACT(MONTH FROM SaleDate) AS MM
  FROM "Orders.db"
  WHERE (SaleDate BETWEEN "01.01.1998" AND "31.05.1998")

However, with a Windows setting for Short Date Style of dd-MM-yyyy and a
Date Separator setting of a period (-), the same dates no longer work.

  SELECT OrderNo, SaleDate, EXTRACT(MONTH FROM SaleDate) AS MM
  FROM "Orders.db"
  WHERE (SaleDate BETWEEN "01-01-1988" AND "31-05-1988")

This would appear to be a short-coming in how the SQL parser used by the
32-bit BDE works with these literal values in conjunction with Windows
system settings.

I will correct the related information in the local SQL online help file
forthwith!

//////////////////////////////////////////////////////////////////////////
Steve Koterski                    "My problem lies in reconciling my gross
Technical Publications            habits with my net income."
INPRISE Corporation                             -- Errol Flynn (1909-1959)
http://www.borland.com/delphi
Technical Details
Message-ID: <36e74b65.17766972@forums.inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7bk1bs$2i77@forums.borland.com> <36ddce30.1329713@forums.borland.com> <36e4e115.7047839@forums.inprise.com> <MPG.114868a19e128ae3989fa1@forums.inprise.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,9c0ce2ccf9b5c6e5
X-Google-Attributes: gidff5a1,public
From: skoterski@NOSPAMinprise.com (Steve Koterski)
Subject: Re: Date field in sql builder
Date: 1999/03/05
Message-ID: <36e74b65.17766972@forums.inprise.com>
X-Deja-AN: 451699341
Content-Transfer-Encoding: 7bit
References: <7bk1bs$2i77@forums.borland.com> <36ddce30.1329713@forums.borland.com> <36e4e115.7047839@forums.inprise.com> <MPG.114868a19e128ae3989fa1@forums.inprise.com>
Content-Type: text/plain; charset=us-ascii
Organization: INPRISE Corporation, Technical Publications
Mime-Version: 1.0
Reply-To: skoterski@NOSPAMinprise.com
Newsgroups: borland.public.vdbase.data.sql