Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    May 2010
    Posts
    215
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Trouble with Order By

    edit, ignore this thread, I already found the problem, I miss that there is this code
    PHP Code:
    $query1 $query1 "order by "$SCHEMAx ."ZSD_DRLIST.KUNNR, "$SCHEMAx ."ZSD_DRLIST.LIFEX"

    If I put this
    PHP Code:
    ORDER BY ZSD_DRLIST.EAN11 

    at the end of the query here below, the query no longer works. What is the reason for this?
    PHP Code:
    $query1 "select  distinct ZSD_DRLIST.BSTNK,ZSD_DRLIST.LIFEX,ZSD_DRLIST.WADAT,ZSD_DRLIST.BSTDK,ZSD_DRLIST.KUNNR,ZSD_DRLIST.MATNR, ZSD_DRLIST.TPPULLOUT, ZSD_DRLIST.TPSOLDOUT, ";
                
    $query1 $query1 "ZSD_DRLIST.EAN11,ZSD_DRLIST.DISCPER,ZSD_DRLIST.KBETR, KNA1.NAME1, KNA1.NAME2, KNA1.NAME3, KNA1.NAME4, ZZLONGTEXT, ADJ, LFIMG ";
                
    $query1 $query1 "from "$SCHEMAx ."ZSD_DRLIST ";
                
    $query1 $query1 "left join "$SCHEMAx ."KNA1 on "$SCHEMAx ."ZSD_DRLIST.KUNNR = "$SCHEMAx ."KNA1.KUNNR and "$SCHEMAx ."ZSD_DRLIST.MANDT = "$SCHEMAx ."KNA1.MANDT ";
                
    $query1 $query1 "left join "$SCHEMAx ."ZMM_MATDEL on "$SCHEMAx ."ZSD_DRLIST.MATNR = "$SCHEMAx ."ZMM_MATDEL.MATNR and "$SCHEMAx ."ZSD_DRLIST.MANDT = "$SCHEMAx ."ZMM_MATDEL.MANDT ";
                
    $query1 $query1 "left join "$SCHEMAx ."ZSD_DRLIST_ADJ on "$SCHEMAx ."ZSD_DRLIST.BSTNK = "$SCHEMAx ."ZSD_DRLIST_ADJ.XBLNR and "$SCHEMAx ."ZSD_DRLIST.MATNR = "$SCHEMAx ."ZSD_DRLIST_ADJ.MATNR and "$SCHEMAx ."ZSD_DRLIST.MANDT = "$SCHEMAx ."ZSD_DRLIST_ADJ.MANDT ";
                
    $query1 $query1 "where "$SCHEMAx ."KNA1.MANDT = '"$MANDTx ."' ";
                
    $query1 $query1 "and WADAT >= '"$sdate ."' and WADAT <= '"$edate ."' and AUART = '"$transtype ."' ";
                
    $query1 $query1 "and ZSD_DRLIST.NAME1 >= '"str_replace("\\","",$fromcustomer) ."' and ZSD_DRLIST.NAME1 <= '"str_replace("\\","",$tocustomer) ."'  "
    Last edited by Anishgiri; 09-16-2013 at 04:35 AM.


 

Posting Permissions

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