how to go to another query result if Row = 0? (1 Viewer)

JCross

Registered User.
Local time
Today, 15:27
Joined
Feb 28, 2002
Messages
116
Hi Everybody!

I have a query that averages some costs, but if the item hasn't come in, the result in query.lastcost will be 0.

if it's 0, I need to get the result from another query for that item. How do I do this? ( I have the other query built already) Do I need to give more information? Thank you!!!


Jennifer

p.s. - this query result needs to be used by reports and other queries.....so i know that if it was a FORM i could do a DLookup to the other query, but how do I do this in a query and not in code????So confused.....
 
Last edited:

Alexandre

Registered User.
Local time
Today, 21:27
Joined
Feb 22, 2001
Messages
794
At first 'sight' I'd say a possible approach would be to have 3 queries: your first one that gives you the 0s. Your second one that treats the 0s cases. A third one, a union query, with a select clause to skip unwanted records (with 0s), would merge results from both queries.

There may be a better approach but without more details about your queries (eventually SQL) it is hard to be more specific.

BTW congratulations :)
 
Last edited:

JCross

Registered User.
Local time
Today, 15:27
Joined
Feb 28, 2002
Messages
116
Thanks! I think I'll give it a try.......sounds like I can make it work.


Jen
 

JCross

Registered User.
Local time
Today, 15:27
Joined
Feb 28, 2002
Messages
116
oh - and thanks! he's two months old tomorrow :D i'm a proud mama.
 

Users who are viewing this thread

Top Bottom