🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: BETWEEN and DATE filter

#1363
From: Andrea Starz
Date: Thu, 12 Feb 1998 00:00
44 lines
1806 bytes
Steve Koterski wrote:
> 
> 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!)

Ok , another error :

"Database Engine Error: Type mismatch in expression"

N.B.: Date are in format dd/mm/yy, is important?

Andrea
Technical Details
Message-ID: <34E31E68.C15@mbox.vol.it>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <34E18B86.6F7A@mbox.vol.it> <34e5ee29.8053776@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,4441f152cccd222a
X-Google-Attributes: gidff5a1,public
From: Andrea Starz <starzand@mbox.vol.it>
Subject: Re: BETWEEN and DATE filter
Date: 1998/02/12
Message-ID: <34E31E68.C15@mbox.vol.it>
X-Deja-AN: 324470282
Content-Transfer-Encoding: 7bit
References: <34E18B86.6F7A@mbox.vol.it> <34e5ee29.8053776@forums.borland.com>
Content-Type: text/plain; charset=us-ascii
Organization: None
Mime-Version: 1.0
Newsgroups: borland.public.vdbase.data.sql