John,

just to warn you:

1. DTOC() will return different results depending on your SET DATE setting.

2. Passing parameters is a much safer (and easier) solution than converting values to strings to pass them to your back end.

3. You should still trap the return and check aerror() if the return value is < 0

Frank.

Frank Cazabon

On 11/01/2013 12:28 PM, John J. Mihaljevic wrote:
This worked, but instead of using {...} as in {dtoc(startdate)}, it required
me to use '...' as in 'dtoc(startdate)'. Everything works perfectly now.

Thanks very much to all for their suggestions! All were very helpful.

John

-----Original Message-----
From: Rafael Copquin [mailto:[email protected]]
Sent: Friday, January 11, 2013 6:11 AM
To: [email protected]
Subject: Re: Error executing SQL commands on a SQL table

Your command should be written like so:

sqltxt='DELETE FROM DailyProductionFoxPro WHERE
proddate>='+'{'+dtoc(startdate)+'}'
xstr=sqlprepare(cnTransfer,sqltxt)


Rafael Copquin





[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to