How to display columns in the right order from a SQL DB query

N

Neall

I am using a universal SQL editor and when I get the results from my DB query
using that tool, the columns are in the correct order in which I have placed
them.

However when I use the same SQL query in Excel and the data is displayed the
columns are in the wrong order.

Any suggestions
 
P

Pranav Vaidya

This is very little infor to answer. I need to know the SQL you are using,
however try using the actual column names instead of * in your SELECT
statement.
 
N

Neall

Here is and example of what I am doing

SELECT
XXX.DAYSOPEN "XXX AGE",
XXX.PM "XXX #",
XXX.BNO,
XXX.CNO,
XXX.SEVERITY"SEV",
XXX.CUST "CUSTOMER",
XXX.PROD "PROD",
FROM
AAAAA.XXX AS XXX

LEFT JOIN SER.DIS AS DIS (took out some of the join info)

LEFT JOIN SER.XXX AS LXXX (took out some of the join info)

WHERE XXX.STAT = 'O' AND
XXX.PRODID IN ('VVVV', 'BBBB', 'CCCC')


ORDER BY XXX.DAYSOPEN DESC

Again all the information is retrieved correctly but the order in which I
have the select statement does not come back the same order
 

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