+ Reply to Thread
Results 1 to 2 of 2

Thread: Select Statement

  1. #1
    Guest.Visitor Guest

    Default Select Statement

    Roger, Try using the fields position on the output; which in this case, the Order By statment would read like this: Order by 30, Imdsc1 Be aware that any change to the order of the preceeding fields will require a re-designation of the field number. In case you don't understand why you have this problem, it's because Odytid is not a field on the output record, that position -could be- Odytid, but it could also be the unnamed field value of blank. Bill "Roger" wrote in message news:2283a6af.-1@WebX.WawyahGHajS... > I am trying to use the following select statement but when I try to run it it gives me a error. (ORDER BY column ODYTID or expression not in result table.) > > SELECT Sddoco, Sddcto, Sdkcoo, Sdmcu, Sditm, Sdlitm, Sdlnid, > Sdurcd, Sdlprc, Sdsoqs, Sdivd, Sdurat, Sddoc, Sdstop, Sdrout, > Sdshan, Sddeln, Sddftn, Sdlprc, Sduprc, Sduorg, Sdlocn, > Imrvno, Imdsc1, Imlitm, Imuom1, Imitm, Imsrp5, Imurrf, > ifnull(Odytid,' '), ifnull(Odyccd,0) FROM F4211 inner join F4101 > on Sditm = Imitm left outer join F5642103 on Sddoco = Oddoco > and Sditm = Oditm and Sdlnid = Odlnid WHERE Odyccd = ? and > Odytid <> ? ORDER BY Odytid, Imdsc1

  2. #2
    Guest.Visitor Guest

    Default Select Statement

    Roger, If you want to avoid the positional notation that Bill mentions, you can also use something like: select ...ifnull(odytid,' ') as odytid from file order by odytid David Morris

+ Reply to Thread

Similar Threads

  1. Using a variable in an SQL select statement.
    By Guest.Visitor in forum Java
    Replies: 2
    Last Post: 06-18-2007, 07:44 AM
  2. READE in a Select Statement
    By MichaelAiese in forum RPG
    Replies: 4
    Last Post: 10-02-2003, 10:30 AM
  3. Select Statement - Need Help
    By Guest.Visitor in forum General
    Replies: 1
    Last Post: 09-25-2003, 08:19 AM
  4. Using IN in Select statement
    By dchristie in forum Programming
    Replies: 1
    Last Post: 02-16-2001, 09:50 AM
  5. SELECT statement
    By Guest.Visitor in forum Programming
    Replies: 6
    Last Post: 08-04-2000, 02:53 PM

Posting Permissions

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