🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Problem with parameters and date fields

#1304
From: Francesco
Date: Mon, 09 Aug 2004 10:12
34 lines
1615 bytes
Ohhps I forgot, I use MSDE 2000 with BCB 5.


> 
> Hello, 
> 
> I've a problem, a simple query like the follow give me the wrong
> result TOTAL=0
> 
> 
> ADOQuery1->Close();
> ADOQuery1->SQL->Clear();
> ADOQuery1->SQL->Add("SELECT COUNT(*) AS TOTAL FROM SCHEMAS WHERE
> DATAARR < :data1 AND DATAPAR >= :data1");
> ADOQuery1->Parameters->ParamByName("data1")->Value =
> StrToDate("13/08/2004");
> ADOQuery1->Open();
> 
> 
> if I do the same query but in this way, I've the correct result
> TOTAL=1
> 
> 
> SELECT COUNT(*) AS TOTAL
> FROM SCHEMAS
> WHERE DATAARR < CAST('13/08/2004' AS DATETIME)
> AND DATAPAR >= CAST ('13/08/2004' AS DATETIME)
> 
> 
> Is there any know problem using parameters with date fields, both
> fields DATAARR AND DATAPAR are defined as datetime (8).
> 
> 
> thanks, Francesco
Technical Details
Message-ID: <41174df9@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!newsfeed.iinet.net.au!newsfeed.iinet.net.au!PeerFeed.KWeb.on.ca!news.kweb.on.ca!newsgroups.borland.com!not-for-mail
References: <41174ae2@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,33d4f63ac70a410f
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Francesco" <.>
Subject: Re: Problem with parameters and date fields
Newsgroups: borland.public.cppbuilder.database.ado
References: <41174ae2@newsgroups.borland.com>
User-Agent: XanaNews/1.16.3.1
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 217.172.212.72
Message-ID: <41174df9@newsgroups.borland.com>
Date: 9 Aug 2004 03:12:09 -0700
X-Trace: newsgroups.borland.com 1092046329 217.172.212.72 (9 Aug 2004 03:12:09 -0700)
Lines: 36
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!newsfeed.iinet.net.au!newsfeed.iinet.net.au!PeerFeed.KWeb.on.ca!news.kweb.on.ca!newsgroups.borland.com!not-for-mail