Ver Mensaje Individual
  #1  
Antiguo 30-05-2011
Avatar de oscarac
[oscarac] oscarac is offline
Miembro Premium
 
Registrado: sep 2006
Ubicación: Lima - Perú
Posts: 2.010
Reputación: 20
oscarac Va por buen camino
Variable String cambia de valor a ''

buenas noches

tengo un problema

estoy haciendo este query
Código Delphi [-]
      StrSql := 'Select T.empresa, C.TipoConsumo, C.Tdc, C.Doc, C.f_Doc, C.Hora, C.Aux, T.Descl As Trabajador, C.TOT, A.Descl As Producto ' +
                ' from ((( ' +
                'tblConsumoC C With (noLock) ' +
                'Left Join tblConsumoD D With (noLock) on (C.TDC = D.TDC and C.DOC = D.DOC)) ' +
                'Left Join tblTrabajador T With (noLock) on C.Aux = T.KOD) ' +
                'Left Join TblArticulo A With (noLock) on D.KOD = A.KOD) ' +
                ' Where C.F_DOC Between ' + QuotedStr(FormatDateTime('DD/MM/YYYY', dtFechaIni.Date)) + ' and ' +
                QuotedStr(FormatDateTime('DD/MM/YYYY', dtFechaFin.Date)) + ' and TipoConsumo = ' + QuotedStr('K');
 
      if rgEmpresa.ItemIndex <> 0 then
        StrSql := StrSql + ' and C.Empresa = ' + QuotedStr(IntToStr(rgEmpresa.itemindex)) +
            ' Order by T.Empresa, C.TipoConsumo, T.Descl, C.Tdc, C.Doc'
      Else
        StrSql := StrSql + ' Order by T.Empresa, C.TipoConsumo, T.Descl, C.Tdc, C.Doc'

cuando llega a esta parte

Código Delphi [-]
 
      if rgEmpresa.ItemIndex <> 0 then
        StrSql := StrSql + ' and C.Empresa = ' + QuotedStr(IntToStr(rgEmpresa.itemindex)) +
            ' Order by T.Empresa, C.TipoConsumo, T.Descl, C.Tdc, C.Doc'
      Else
        StrSql := StrSql + ' Order by T.Empresa, C.TipoConsumo, T.Descl, C.Tdc, C.Doc'

la variable StrSql se convierte en '' (blanco)


alguien sabe porque?

P.D. la variable strSql es de tipo String. ya probe con wideString y tambien pasa lo mismo

saludos
__________________
Dulce Regalo que Satanas manda para mi.....
Responder Con Cita