Article View: borland.public.vdbase.data.sql
Article #1360Re: BETWEEN and DATE filter
From: Steve Koterski
Date: Wed, 11 Feb 1998 00:00
Date: Wed, 11 Feb 1998 00:00
34 lines
1639 bytes
1639 bytes
On Wed, 11 Feb 1998 12:29:10 +0100, Andrea Starz <starzand@mbox.vol.it>
wrote:
>I want to select record between two date, if i wrote:
>
>SELECT OL_AGG, COUNT( DISTINCT COM_AGG )
>FROM "C:\APPL\ACOL\aggiorna.dbf" Aggiorna
>WHERE DATA_AGG BETWEEN {01/12/97} AND {31/12/97}
>ORDER BY OL_AGG
>
>an error "invalid use of keyword {" occour.
>
>Where is the method to write a date value?
Try enclosing the date literals in double-quotes.
Also, mixing aggregated and non-aggregated columns in the SELECT clause
columns list without having a GROUP BY clause does not look right and may
produce incorrect or no results.
Try something like:
SELECT OL_AGG, COUNT(DISTINCT COM_AGG)
FROM "C:\APPL\ACOL\aggiorna.dbf"
WHERE (DATA_AGG BETWEEN "01/12/97" AND "31/12/97")
GROUP BY OL_AGG
ORDER BY OL_AGG
**************************************************************************
Steve Koterski
Borland International, Inc.
http://www.borland.com/delphi
(Remove the "SPICEDHAM2" from the address. Death to spam-bots!)
Technical Details
Message-ID:
<34e5ee29.8053776@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34E18B86.6F7A@mbox.vol.it>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,4441f152cccd222a X-Google-Attributes: gidff5a1,public From: koterski@SPICEDHAM2borland.com (Steve Koterski) Subject: Re: BETWEEN and DATE filter Date: 1998/02/11 Message-ID: <34e5ee29.8053776@forums.borland.com> X-Deja-AN: 324182753 Content-Transfer-Encoding: 7bit References: <34E18B86.6F7A@mbox.vol.it> Mime-Version: 1.0 Reply-To: koterski@SPICEDHAM2borland.com Content-Type: text/plain; charset=us-ascii Organization: Borland International, Technical Publications Newsgroups: borland.public.vdbase.data.sql