Karen,
You've had a lot of good advice. Let me add a few more words:
1. First, check my point about semi-colons (see above). I think it could solve your immediate problem, but other issues might remain.
2. Whenever you call SQLEXEC(), it's a good idea to trap and test the returned value. If it's negative, use AERROR() to get an informative error message. In most cases, that's all you need to figure out what went wrong.
3. Whenever you post a question on Tek Tips about back-end databases, specify the database you are accessing. At one point, you mentioned Query Analyzer, which indicates SQL Server, but that wasn't evident from your original post. The point is that different databases have slightly different syntax, and what works in, say, Oracle might throw an error in, say, MySQL.
4. Most back-end databases have a console or "immediate mode", where you can type some SQL code and see the result straight away. (As you know, that's what Query Analyzer does in SQL Server.) If a command doesn't work in VFP, switch to the console to debug and experiment.
5. As others have said, using TEXT / ENDTEXT is a good way of coding your SQL code in VFP, as it allows you to use indentation and white space to make it readable. Also, it's easier to paste from the TEXT / ENDTEXT construct into Query Analyzer or whatever.
I hope the above will help.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro tips, advice, training, consultancy
Custom software for your business