🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Data Type Mismatch in Criteria Expression

#1359
From: Viatcheslav V. Vassiliev
Date: Mon, 26 Jul 2004 17:24
36 lines
2073 bytes
It depends on DBMS. General solution that should work with any DBMS is to
use parameter for dates.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Kim Utley" <kim@simsware.com> �������/�������� � �������� ���������:
news:41052c3f$1@newsgroups.borland.com...
> Hi All,
>
> Am working on BCB 6 with TADO... objects, specifically TADOConnection and
> TADOQuery in my example problem. I am attempting to delete all rows in a
> table that have a date/time stamp older than 'x' amount of days.
>
> I am issuing the following SQL statement be am getting "Data type mismatch
> in criteria express' exception:
>
> DELETE FROM EventHistoryTbl WHERE DateTimeStamp < '06/26/04 10:17:30'
>
> I've also tried:
>
> DELETE FROM EventHistoryTbl WHERE DateTimeStamp < #06/26/04 10:17:30#
>
> Does anyone know why I'm getting this error?
>
> Kindest Regards,
>
>
> Kim L. Utley
>
>
Technical Details
Message-ID: <41053e2f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41052c3f$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,8373fe4b7c83316d
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <41052c3f$1@newsgroups.borland.com>
Subject: Re: Data Type Mismatch in Criteria Expression
Date: Mon, 26 Jul 2004 21:24:01 +0400
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 213.234.218.42
Message-ID: <41053e2f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090862639 213.234.218.42 (26 Jul 2004 10:23:59 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail