SQL Sort Order
Results 1 to 7 of 7

Thread: SQL Sort Order

  1. #1
    King of the Mermaids Diver01's Avatar
    Join Date
    Mar 2000
    Location
    Minnisoooda (cold wasteland)
    Posts
    1,443

    SQL Sort Order

    I am having a bit of trouble getting a MSAccess DB to sort using an SQL statement. Everything sorts ok up to the point where I need a column sorted in DESC order. I think I may be trying to sort 'TO much' but im not sure... here is the statement I wrote...


    SELECT * FROM CentralData WHERE CentralData.ELT_PRTDT Is Null
    ORDER BY CentralData.WKSTCK, CentralData.WKSLBL, CentralData.WKCST, CentralData.WKLRPC DESC, CentralData.WKCHDR, CentalData.WKITEM;

    It stops sorting at CentralData.WKLRPC DESC

    Any help would be appreciated..
    W

  2. #2
    Registered User kingtbone's Avatar
    Join Date
    May 2001
    Location
    Freddy Beach
    Posts
    794
    I might be crazy, but I don't think SQL likes having spaces in the field names very much. When it hits that point of your statement, it is expecting something else. Once again, I might be crazy.
    Hard work often pays off in the long run, but Lazyness always pays off now.

  3. #3
    King of the Mermaids Diver01's Avatar
    Join Date
    Mar 2000
    Location
    Minnisoooda (cold wasteland)
    Posts
    1,443
    Thanks for the reply. I actually feel really stupid but that sql statement was correct. I was looking at a backup and not the live statement that was actually running. When I fixed that it all fell into place. Thanks though..

    It didn't seem to mind the spaces. So I left them in...
    W

  4. #4
    Geezer confus-ed's Avatar
    Join Date
    Jul 1999
    Location
    In front of my PC....
    Posts
    13,087
    Originally posted by kingtbone
    I might be crazy, but I don't think SQL likes having spaces in the field names very much. When it hits that point of your statement, it is expecting something else. Once again, I might be crazy.
    Well I'm confus-ed So being crazy is ok with me ...

    If it didn't like spaces (I think you are right there are implementations of SQL that don't - so if Diver01 bears that in mind should he need to connect to any external databases) then it'd kick an 'iilegal object' message ... not do the 'order by' clause wrongly ....

    So you ain't crazy - just a little confus-ed

  5. #5
    King of the Mermaids Diver01's Avatar
    Join Date
    Mar 2000
    Location
    Minnisoooda (cold wasteland)
    Posts
    1,443
    Originally posted by confus-ed
    Well I'm confus-ed So being crazy is ok with me ...

    If it didn't like spaces (I think you are right there are implementations of SQL that don't - so if Diver01 bears that in mind should he need to connect to any external databases) then it'd kick an 'iilegal object' message ... not do the 'order by' clause wrongly ....

    So you ain't crazy - just a little confus-ed
    SO were all in agreement then. Eveyone is Confused..
    that knowledge somehow makes things clearer doesnt it?
    W

  6. #6
    Geezer confus-ed's Avatar
    Join Date
    Jul 1999
    Location
    In front of my PC....
    Posts
    13,087


    ... the profusion of confusion is compounded by the increase in information, without any proportional aquistion of wisdom ... Einstein (of all people!) defending his theory of relativity ! Mmmm

  7. #7
    King of the Mermaids Diver01's Avatar
    Join Date
    Mar 2000
    Location
    Minnisoooda (cold wasteland)
    Posts
    1,443
    I can't help but wonder what Einstein would think about all the wonderful technology of today. I bet he would have some interesting theories...

    NanoTechnology
    The Space Time Continuim (sp)
    The Klingons
    hehehe..

    Speaking of which.. I wonder why the Borg never attacked the Klingons or the Romulans or even the Vulcans? Hmmmmm.....
    W

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •