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;



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

Reply via email to