Variable in SQL Statement

Ken Ray kray at sonsothunder.com
Mon Feb 5 17:42:48 EST 2007


On Mon, 5 Feb 2007 17:30:19 -0500, Jeff Honken wrote:

> I've been trying to put a wildcard "%" into a SQL statement that
> contains a variable.  I just can't seem to find the right format.
> Here's the SQL statement:
> 
> put revQueryDatabase(gConID, "SELECT ClaimNum FROM AccountEntry WHERE
> ClaimNum LIKE '" & QueryDate & "'&% ORDER BY ClaimNum DESC LIMIT 1")
> into q

I think it's because the ampersand is inside the query itself, try this:

 put revQueryDatabase(gConID, "SELECT ClaimNum FROM AccountEntry WHERE
 ClaimNum LIKE '" & QueryDate & "%' ORDER BY ClaimNum DESC LIMIT 1")
 into q

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list