Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax error in SELECT

Status
Not open for further replies.

tedbain

Technical User
Aug 15, 2001
19
AU
the first two snippets from command window do not work (giving 'syntax error') but the third and fourth do...
sele desc from plans
sele desc,km1 from plans
sele km1 from plans
sele km1,desc from plans

On a similar vein, some years ago, amongst other items, I had a query that failed to find any rows where fieldxx='L' but found rows (starting with 'L' if selecting for fieldxx>'K'

The first is a pain; the second could potentially cause major errors (of omission).

Somewhat curious as to whether there are any general rules for predicting these wierd failures? also just how common are they?

Thanks for any guidance

Ted
 
desc is a reserved word "descending", rename this field in your table and the problem will be over.

Rob.
 
As rob444 said, 'DESC' is a keywork so Fox thinks you are trying to run the query in descending order, but haven't named a table to run the query on. You either need to rename it in the table or you can preface it with the table or alias:
sele plans.desc from plans
-or-
sele a.desc from plans

For the 'L' issue, it's hard to say what may be going on there, especially since it was a long time ago. Could be many things like a bad filter condition, index, ....


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Slight correction on Dave's suggestion:

-or-
sele a.desc from plans a


Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top