I assume that I will have to write "01/01/02"

Thanks for the help. Let's hope that there aren't any more questions of this
ilk and I can continue to port my application.

No'am

-----Original Message-----
From: Martijn Tonies [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 4:47 PM
To: [EMAIL PROTECTED]
Subject: Re: Re[2]: Comparing date fields





> mysql>> select projects.name from projects
> JB>     -> where projects.closeddate between :fd and :td;
> JB> ERROR 1064: You have an error in your SQL syntax near ':fd and :td' at
> JB> line
> JB> 2
> JB> What are those colons?
>
> He probably uses Delphi or C++Builder to connect to mysql via TQuery
> component. TQuery has a property SQL where sql statement is stored.
> The colon ':' means that fd is a parameter whose value should be
> inserted into TQuery.SQL statement just before executing the query.
>
> The solution is to substitute :fd with a real value directly by accessing
TQuery.SQL
> property.
> Query.SQL.Clear;
> Query.SQL.Add('select ...');
> Query.SQL.Add('where projects.closeddate between 01/01/01 and 01/01/02');
> Query.Open;

I very much doubt this works:

01 divided by 01 :-)

I guess you wanted to write:

'01/01/01'

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to