General information
Category:
Coding, syntax & commands
The columns or expressions used in the ORDER BY clause must match columns or expressions selected from the
table(s). So, if you need to order by VAL(docno), you have to select VAL(docno) from the table. After that, the ORDER BY
can include VAL(docno), the alias of the field (as in Robert's solution) or the column number.
Vlad
>We are still trying to optimise a huge data export. we need to sort the data before exporting, by two fields:
> logdate (date) docno (char(4))
>This works, but due to docno being char, not quite right:
>select * from docinfo into cursor working ;
> order by logdate ASC, docno ASC
>
>Trying
> order by logdate, VAL(docno)
>returns SQL: colum logdate is not found
>
>for fun (or is it frustration) we tried just VAL(docno) and got:
> column not found.
>
>Both fields are indexes.
Previous
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