Union Query asking for Parameter Value

S

stephiesunny

I want the query to pull in all values.
Both PaymentNet_Spend and PeopleSoft_Spend are queries.

SELECT [PaymentNet_Spend].[Trans ID], [PaymentNet_Spend].[Post Date],
[PaymentNet_Spend].[Trans Amount], [PaymentNet_Spend].[Display Name]
FROM PaymentNet_Spend
UNION ALL SELECT [PeopleSoft_Spend].[Trans ID], [PeopleSoft_Spend].[Post
Date], [PeopleSoft_Spend].[Trans Amount], [PeopleSoft_Spend].[Display Name]
FROM PeopleSoft_Spend;

Please let me know if you have any suggestions. Thanks!
 
J

John W. Vinson

I want the query to pull in all values.
Both PaymentNet_Spend and PeopleSoft_Spend are queries.

SELECT [PaymentNet_Spend].[Trans ID], [PaymentNet_Spend].[Post Date],
[PaymentNet_Spend].[Trans Amount], [PaymentNet_Spend].[Display Name]
FROM PaymentNet_Spend
UNION ALL SELECT [PeopleSoft_Spend].[Trans ID], [PeopleSoft_Spend].[Post
Date], [PeopleSoft_Spend].[Trans Amount], [PeopleSoft_Spend].[Display Name]
FROM PeopleSoft_Spend;

Please let me know if you have any suggestions. Thanks!

Since we have no information about the two queries nor about what you're
seeing (or expect to see, or want to see), I can't see how anyone can help.

Are you missing values that you think you should be seeing? Do the individual
queries return "all values" on their own? What specific problem are you
having, in other words?
 
K

KARL DEWEY

There is no need to have three queries. Just take the first query and copy
the SQL and paste into the second, removing semicolon, and adding UNION.

Delete the first query.
 
S

stephiesunny

John-

Both PaymentNet_Spend and PeopleSoft_Spend are queries that include the
Trans ID, Post Date, Trans Amount, and Display Name without any parameters
around them (when I run them on their own). I'm trying to merge these two
queries so that the data output can come from both queries if I want total
spend. But I have them separate so that I can keep the dollars separate for
other reporting. These queries are derived from numerous tables. PaymentNet
has approx. 150,000 lines of data and PeopleSoft has approx. 50,000. What I
expect to see are still the Trans ID, Post Date, Trans Amount and Display
Names, as I do when I run the queries separately and without the Union. I
want the merged data to be inclusive of ALL data, not with prompts for
parameters.

I hope that this is more clear. Thank you for your help :)

Stephanie
 
J

John W. Vinson

John-

Both PaymentNet_Spend and PeopleSoft_Spend are queries that include the
Trans ID, Post Date, Trans Amount, and Display Name without any parameters
around them (when I run them on their own). I'm trying to merge these two
queries so that the data output can come from both queries if I want total
spend. But I have them separate so that I can keep the dollars separate for
other reporting. These queries are derived from numerous tables. PaymentNet
has approx. 150,000 lines of data and PeopleSoft has approx. 50,000. What I
expect to see are still the Trans ID, Post Date, Trans Amount and Display
Names, as I do when I run the queries separately and without the Union. I
want the merged data to be inclusive of ALL data, not with prompts for
parameters.

That's what I'd expect that you WOULD see! What prompts do you get?
 
S

stephiesunny

The prompts are PaymentNet_Spend.[Display Name] and PeopleSoft_Spend.[Display
Name]. I don't want to run the reports for ONLY one vendor, I want ALL
vendors inclusive, which is why I use UNION ALL in the query. So I'm a little
confused as to why it is asking for the Display Names of both. ....?????
 
S

stephiesunny

Oh! I figured it out!! My query as written has "Display Name" with a space,
however my other query outputs have "DisplayName" with no space. Sheesh. I'm
still learning this database stuff and keep coming across funny things like
that. Thanks for your help John. :)
 
J

John W. Vinson

Oh! I figured it out!! My query as written has "Display Name" with a space,
however my other query outputs have "DisplayName" with no space. Sheesh. I'm
still learning this database stuff and keep coming across funny things like
that. Thanks for your help John. :)

Not that I did much... <bg>

Any time you get an unexpected prompt, the first thing to look for is this
kind of misspelled fieldname - anything in brackets that Access doesn't
recognize will be taken as a parameter and generate a prompt.
 

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