Sorting two different fields

G

Guest

I have a database that has fields ED1 and ED2. My report shows the result of
either ED1 or ED2, depending if ED2 is null or not. My problem is that
everything is fine if all are ED1 but once there is also an ED2 entry it
shows sorting as just ED1.

Example:

2/28/2005
2/28/2005
2/28/2008 - ED2 ( ED1 was 2/28/2005)
2/28/2005
It seems it still sorts on the ED1

I've tried all sorts of things but I'm lost. Any help??
 
B

Bob Howard

Unless I'm not understanding correctly ...

Within the Query that underlies this report, create a calculated field and
use this as the field for your report.

For example, in the Query, in a blank column, enter the following

EDResult: IIf(Isnull(ED2),ED1,ED2)

The above creates a field (in the query, so it's accessible to the report)
called EDResult. If ED2 is null, it'll contain the value from ED1 ---
otherwise it'll contain the value from ED2.

Now change your report to refer to the field EDResult and see what happens..

Bob.
 
G

Guest

Thanks Bob
It works, the only yhing is when I open the report it asks for a parameter
value(ED). I just click on the blank and the report comes up just right. Is
there something I should have done or not done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top