Can't Sort in Query

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

Hi, hope someone can help.

I have constructed a simple query with three columns -
first column is a field from a table in my database;
second column uses the Right(string,n) function to return
the last character from the value in the first column; the
third column takes the character from the second column
and uses this in a function I have created to return
another value. Query runs perfectly until I attempt to
apply a sort order to my third column - when I do this it
behaves like a parameter query and prompts for me to enter
the value from my second column. What's happening and how
can I fix this?

TIA
 
Save the first query, then use it as a source for another query that
sorts the first one.

Pavel
 
I get this if I refer to one formula field in another formula field.

So if one field is MySum: Field1 + Field2

and another says

MyOtherSum: MySum/Field2

sometimes it works and sometimes it doesn't. But by the time I have a third
field based on the other two

YetAnotherSum: MySum * MyOtherSum

I nearly always get a problem if it's any more than a simple sum.

What I have to do is to replace the calculated field with the formula in it

eg YetAnotherSum:(Field1 + Field2) * ((Field1 +Field2)/Field2)

You can paste the formula from one calculation into the combination.

Evi
 
Hi,
You have to sort on the expression itself, not the name of the calculated field
Example:

Select Left([someField], 5) AS Test
Order By Left([someField], 5)

if you use:
Order By Test
it won't work.
 
Back
Top