Stumped on SQL

jrmondonedo

Registered User.
Local time
Tomorrow, 01:17
Joined
Jan 3, 2014
Messages
16
I created an Income/Expense Report from two separate queries so I made a Union Query with the following SQL construction:

SELECT [Transactions Extended].*
FROM [Transactions Extended]
WHERE ((([Transactions Extended].[Income/Expense])="Income"));
UNION ALL SELECT [Transactions Extended].*
FROM [Transactions Extended]
WHERE ((([Transactions Extended].[Income/Expense])="Expense"));

The output displays "Expenses" first before "Income."

My question is how can I reverse the output where "Income" would be displayed first before "Expenses"?

HELP!
 
You don't need the UNION:

SELECT [Transactions Extended].*
FROM [Transactions Extended]
ORDER BY [Transactions Extended].[Income/Expense] DESC
 
HI! Appreciate the prompt advise.

I created a new query using the sql construction you provided but after creating the report using the new query it's still displaying expense before income.

Apologies but I'm totally green when it comes to these things.
 
Run the query native i.e. outside the report. In which sequence does the data appear?
 
That's what I did right after posting my response and it's running as expected: income before expense.

I think I might be doing sumthing wrong with the report...

Any advise on how I'm supposed to proceed?
 
Last edited:
Hey again :)

Got it this time. Just made some adjustments on the report and everything displayed as I would want it to.

Yout assistance is much appreciated.
 
Yep, I've fallen for that in the past - report sequence property that (quite rightly) overrides the query's own sequence.
 

Users who are viewing this thread

Back
Top Bottom