SQL code keeps asking for Parameter Value

rplohocky

Active Member
Joined
Sep 25, 2005
Messages
292
Office Version
  1. 365
Platform
  1. Windows
I am trying to create a query from 3 other sources (3 tables). All 3 tables have the same structure and fields. I found this code online to do just that. The issue is when I run the code I have a window that pops up asking for Parameter value for [Curtis C Code],[Hotel Name],[Hotel Brand]. When I click OK on all the 3 pop ups the query is created with all 4 labels across the top and all the Hotel Codes are brought in to the query but none of the data from the other fields.

Can anyone tell me why this doesn't bring in all the data from all of these fields?

<code>select [Hotel Code],[Curtis C Code],[Hotel Name],[Hotel Brand]
FROM [G3 RMS Tracking]
union
select [Hotel Code],[ Curtis C Code],[ Hotel Name],[ Hotel Brand]
FROM [G3 RMS NOT Ready Tracking]
union
select [Hotel Code],[ Curtis C Code],[ Hotel Name],[ Hotel Brand]
FROM [tbl Achived Completed Hotels];
<code/>
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Don't have spaces in field names either. It just cause you grief like this.
If you want decent headings use can use this method

Code:
SELECT [forename] & " " & [Surname] AS [Full Name]
FROM tblEmployee;

which in design mode is
Code:
Full Name: [forename] & " " & [Surname]
 
Upvote 0

Forum statistics

Threads
1,221,692
Messages
6,161,351
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top