Yanıt problem in quary.

  • Saturday, February 09, 2013 8:39 AM
     
     

                                               select  ( sum(msc_order_item.msc_qty_tot_item)/1000) as sumq from (select  name  from salesorder   where msc_cod_prod_fmly_ordheName  in ('05','06','07','90','61') and ( msc_cod_typ_cfm in ('1' , '6')  and (msc_cod_sale_ofcName between '1' and '6'  )  and  dbo.ToPersianDate (msc_dat_acc_ordhe) between(( SELECT   dbo.ToPersianDate(MSC_fromdate )AS fromdate
    FROM         MSC_maching_form  where  MSC_list_number = @listno
                     )) and ((SELECT    MSC_list_number,dbo.ToPersianDate(MSC_todate ) AS todate
    FROM         MSC_maching_form where MSC_list_number = @listno)
      ))) as o     inner join msc_order_item on  msc_order_item .msc_parent_orderName =o.name and  msc_order_item.msc_item_thickness  between '1.2' and ' 4.99'   and msc_order_item.msc_flg_db_ordit=0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

All Replies

  • Saturday, February 09, 2013 10:50 AM
     
     

    Hello,

    And what's the problem here; no one can guess it just by the SQL statement?


    Olaf Helper

    Blog Xing

  • Monday, February 11, 2013 5:29 AM
     
     Answered

    The problem here could be cosmic particle interference with RAM causing random errors to propagate from memory up through the SQL layer.

    I would recommend adding WHERE 1 = 0 

    This will guarantee that no further erroneous data is returned via this code.


    Thanks! Josh Ash