Data | From MySQL using MS Query removes "AS" statements

shanedaven

New Member
Joined
Oct 12, 2010
Messages
2
Have you seen this before and if so do you know how to stop this from happening?

I am using "Microsoft Query" to import mySQL data into a spreadsheet. The data returned from the query is correct, but "Microsoft Query" is removing the "AS" statements. Thus the column headers are either the actual field names or the function I use. It has not done this in the past and I am now worried that if I edit my other queries the same thing will happen.

The query I enter is:

SELECT CONCAT(users_r.firstname, ' ', users_r.realname) as `Owner`,
MID(cat_compname.completename,14,8) as `Category`,
users_g.name as `Team`

FROM glpi_tracking tickets
LEFT JOIN glpi_users users_r ON assign = users_r.ID
LEFT JOIN glpi_dropdown_tracking_category cat_compname ON category = cat_compname.ID
LEFT JOIN glpi_groups users_g ON assign_group = users_g.ID

WHERE LEFT(cat_compname.completename,21) = 'IT-Systems > Projects' AND users_g.name = 'IT-Tech';

Here is what I see when I edit the original query via the "View SQL" button:

SELECT CONCAT(users_r.firstname, ' ', users_r.realname) ,
MID(cat_compname.completename,14,8) ,
users_g.name

FROM glpi_tracking tickets
LEFT JOIN glpi_users users_r ON assign = users_r.ID
LEFT JOIN glpi_dropdown_tracking_category cat_compname ON category = cat_compname.ID
LEFT JOIN glpi_groups users_g ON assign_group = users_g.ID

WHERE LEFT(cat_compname.completename,21) = 'IT-Systems > Projects' AND users_g.name = 'IT-Tech';
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I haven't encountered that, myself, Shane.

Try instead with SELECT whatever AS [this time use square brackets]

If that doesn't help, suggest instead using ADO (from VBA). MS Query seems to be fine for basic work but if things aren't working for you, there are more reliable alternatives.

regards, Fazza
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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