HELP!!!

L

Lori

Okay, I'm not sure if this can be done and I need advice.

I have two queries, one that lists all of the information with the exception
of a field ([DAC Name] in one query = [Bill To:] in the other) where the
entry is "Unassigned", works perfect. The second query only looks at the
"Unassigned". Also works perfectly.

Now, here's what I need help with. I need to merge the data from these two
queries.
One query is below:

SELECT Left([Bill To:],2) AS CO, [Unit Billing].[Bill To:], [UAD
Reports].[Unit Name], [UAD Reports].PTN, [UAD Reports].[Total Current
Charges], [Unit Billing].[#of Hours Billed], ([#of Hours Billed]/160) AS
[Billed %], ([Total Current Charges]*[Billed %]) AS [Billed to Owner], [UAD
Reports].[Account#], [UAD Reports].[Bill Cycle]
FROM [Unit Billing] INNER JOIN [UAD Reports] ON ([Unit Billing].User = [UAD
Reports].[Unit Name]) AND ([Unit Billing].PTN = [UAD Reports].PTN);

Here is the Second:

SELECT Left([DAC Name],2) AS CO, [UAD Reports].[DAC Name], [UAD
Reports].[Unit Name], [UAD Reports].PTN, [UAD Reports].[Total Current
Charges], [UAD Reports].[Bill Cycle], [UAD Reports].[Account#]
FROM [UAD Reports]
WHERE (((Left([DAC Name],2))<>"TU") AND (([UAD Reports].[DAC
Name])<>"UNASSIGNED"))
ORDER BY [UAD Reports].[DAC Name];


What I'm trying to do is list each PTN, their appropriate DAC Name, and
either the "Billed to Owner" value if it exists otherwise the "Total Current
Charges" value.

Naturally my problem is that the "Unassigned" in one query and the <>
"Unassigned" in the other cancel each other out. Is there a way to do this?
 

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

Similar Threads


Top