General information
Category:
Coding, syntax & commands
Denis,
The ODER BY *must* be in the final SELECT only. Since the Help does *not* say any restrictions about TOP, I would suppoose that it *also* should be in the last select.
If you continue to get an error that way, try it without the TOP n and see what you get - if it works, then you may need a second lone select (not UNIONed) to get your TOP n as you want.
Oh Darn - I just also noticed that you do *not* select any fields! This is a *must do too, in *both* selects (even if you want "*" for all fields).
Good Luck,
Jim N
>Hi Jim
>Excuse. I will take it in the future messages.
>
>>>
>>>My code:
>>>SELECT TOP 1 * ;
>>>FROM myDatabase!myTable ;
>>> WHERE myTable.cod = pCod ;
>>> AND myTable.price >=pPrice ;
>>> UNION ;
>------------------------ THE NEXT LINE WITH ERROR
>------------ "Command is missing required clause "
>>> SELECT TOP 1 *;
>>> FROM myDatabase!myTable;
>>> WHERE myTable.cod = pCod ;
>>> AND myTable.price <=pPrice ;
>>>ORDER BY mytable.price ;
>>>INTO CURSOR curPrice
>>>
>>>I receive error message... What the problem ?... OR I do't use TOP 1 AND UNION ?
>>>Thanks for your messages.
>>>Denis.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only