PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

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

 
 
=?Utf-8?B?TmVhbGw=?=
Guest
Posts: n/a
 
      29th Aug 2007
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

--
Neall
 
Reply With Quote
 
 
 
 
=?Utf-8?B?UHJhbmF2IFZhaWR5YQ==?=
Guest
Posts: n/a
 
      29th Aug 2007
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.

--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!


"Neall" wrote:

> 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
>
> --
> Neall

 
Reply With Quote
 
=?Utf-8?B?TmVhbGw=?=
Guest
Posts: n/a
 
      29th Aug 2007
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
--
Neall


"Pranav Vaidya" wrote:

> 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.
>
> --
> Pranav Vaidya
> VBA Developer
> PN, MH-India
> If you think my answer is useful, please rate this post as an ANSWER!!
>
>
> "Neall" wrote:
>
> > 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
> >
> > --
> > Neall

 
Reply With Quote
 
Tim Williams
Guest
Posts: n/a
 
      30th Aug 2007
How are you displaying the returned info in excel ??

Tim

"Neall" <(E-Mail Removed)> wrote in message
news:EC251634-172D-4C06-8315-(E-Mail Removed)...
> 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
> --
> Neall
>
>
> "Pranav Vaidya" wrote:
>
>> 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.
>>
>> --
>> Pranav Vaidya
>> VBA Developer
>> PN, MH-India
>> If you think my answer is useful, please rate this post as an ANSWER!!
>>
>>
>> "Neall" wrote:
>>
>> > 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
>> >
>> > --
>> > Neall



 
Reply With Quote
 
=?Utf-8?B?TmVhbGw=?=
Guest
Posts: n/a
 
      30th Aug 2007
Thanks for responding, I figured out the issue, now onto my next post.

Thanks again
--
Neall


"Tim Williams" wrote:

> How are you displaying the returned info in excel ??
>
> Tim
>
> "Neall" <(E-Mail Removed)> wrote in message
> news:EC251634-172D-4C06-8315-(E-Mail Removed)...
> > 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
> > --
> > Neall
> >
> >
> > "Pranav Vaidya" wrote:
> >
> >> 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.
> >>
> >> --
> >> Pranav Vaidya
> >> VBA Developer
> >> PN, MH-India
> >> If you think my answer is useful, please rate this post as an ANSWER!!
> >>
> >>
> >> "Neall" wrote:
> >>
> >> > 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
> >> >
> >> > --
> >> > Neall

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
display datasheet columns in alphabetical order? a a r o n . k e m p f @ g m a i l . c o m Microsoft Access 2 5th May 2010 06:25 AM
query requires value for a field in order to display results Susan Microsoft Access Queries 1 11th Nov 2008 12:35 PM
Re: crosstab query the date columns are not in order Gary Walter Microsoft Access Queries 0 19th Jan 2007 08:56 PM
Binding collection to a asp.net DataGrid - order of columns display question David Laub Microsoft ASP .NET 0 3rd Aug 2004 09:23 PM
Query and Display an order list using DataList Homa Microsoft ASP .NET 2 19th Oct 2003 11:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:23 PM.