Problema con consulta SQL en el ‘OR’

Estoy tratando de ejecutar un SP, pero me arroja el siguiente error Línea 23 Conversion failed when converting the varchar value '0R2' to data type int.

Realizando una prueba de escritorio, el sp logra ejecutarse hasta el where, pero cuando ejecuto el sp con los ORme arroja el error, no encuentro cual sería el problema de los OR.

Comparto el código:

ALTER PROCEDURE [dbo].[PRC_DOC_BuscarDocumento]  -- PARAMETROS @COLUMNA VARCHAR(50),  @FILTRO  VARCHAR(150) AS     BEGIN         --SET NOCOUNT ON;         SELECT CONCAT(LEFT(t.CDOC, 3), DATEPART(YEAR, FECH), '-', SUBSTRING(t.CDOC, 4, 10)) AS RADICADO,                 t.FECH FECHA,                 tu.NUSU RADICA,                 CASE                WHEN t.CEMP = 1                THEN 'EMPRESA 1'                WHEN t.CEMP = 2                THEN 'EMPRESA 2'                ELSE 'EMPRESA 3'                END AS EMPRESA,                 t.DOCU DOCUMENTO,                 t.SOPO SOPORTE,                 tp.NPROV PROVEEDOR,                 t.FACT FACTURA,                 td.NDES DESTINATARIO,                 t.DESOPC DES_OPCIONAL,                 t.OBS OBSERVACIONES,                 t.ESTA,                 t.FDOC FDOCUMENTAL,                 t1.NUSU USUARIOD,                 t.ESTB,                 t2.NUSU USUARIOC,                 t.FCON FCONTABILIDAD,                 t.ESTC,                 t.FECHP RECIBIDA,                CASE                    WHEN t.EPROV = '1'                    THEN 'SI'                    ELSE 'NO'                END AS EN_PROVEEDOR,                 t.ESTD,                 t.FENVI ENVIADA,                CASE                    WHEN t.ANULADA = '1'                    THEN 'SI'                    ELSE 'NO'                END AS ANULADA         FROM TDOCUMENTAL t              INNER JOIN TUSUARIOS tu ON t.CUSU = tu.CUSU              LEFT JOIN TUSUARIOS t1 ON t.USUD = t1.CUSU              LEFT JOIN TUSUARIOS t2 ON t.USUC = t2.CUSU              --INNER JOIN TEMPRESAS te ON t.CEMP = te.CEMP              INNER JOIN TPROVEEDORES_AG_TEMP tp ON t.CPROV = tp.CPROV              INNER JOIN TDESTINATARIOS td ON t.CDES = td.CDES         WHERE t.DOCU <> 'NO RADICABLE'               OR (@COLUMNA = 'FACTURA'                   AND t.FACT LIKE '%' + @FILTRO + '%')               OR (@COLUMNA = 'PROVEEDOR'                   AND tp.NPROV LIKE '%' + @FILTRO + '%')               OR (@COLUMNA = 'NIT'                   AND t.CPROV LIKE '%' + @FILTRO + '%')               OR (@COLUMNA = 'RADICADO'                   AND t.CDOC LIKE '%' + @FILTRO + '%')               OR (@COLUMNA = 'DESTINATARIO'                   AND td.NDES LIKE '%' + @FILTRO + '%')         ORDER BY LEFT(t.CDOC, 3),                   CAST(REPLACE(t.CDOC, LEFT(t.CDOC, 3), 0) AS INT) ASC;     END; 

Agradezco sus aportes!

Handling $AND$ and $OR$ cases in MILP?

Suppose I want to have an integer program for handling the cases

  1. $ x_1>1\wedge x_2>1\wedge x_3>1\wedge\dots\wedge x_n>1\iff\delta=1$

  2. $ x_1>1\vee x_2>1\vee x_3>1\vee\dots\vee x_n>1\iff\delta=1$

how many number of integer variables are needed to handle case?

Is it possible at least one of them needs at most a constant number of binary variables?

What should i expect after editing lockscreen appearances. emediate changes or..?

I recently switched from windows to ubuntu, and as a web developer i am pretty familiar with the ubuntu gnome-shell css. i tried modifying first by running file explorer as an admin. I made the changes but nothing takes effect even after rebooting, when i check the edited source code, the changes are saved but no results. is there some kind of thing to do that validates the edited version or i went wrong somewhere? I just prefer my user login image rounded rather than with 3px radius. Help pls.

Showing item-level & order-level offers/promotions on Details page (PDP) &/or Cart page?

I have 2 types of offers (promotions) applicable on my eCommerce website:

  • Item level offers (example: Item belongs to Brand XYZ. Buy any 2 items from brand XYZ to get 30% off)
  • Order level offers (example: $ 10 off on total purchase of $ 100 worth of items)

Journey of user will be: User will go to the Details page of an item, User will see all the item-level offers applicable to the item, user will add the item to the cart, user will come to the Cart page.

Assumption: The user has added 5-6 items in the Cart page, and each of these items has 2-3 item-level offers associated with it, and there are 2-3 order-level offers applicable too.

Question is:

  • Where should I list the item-level offers associated with the item?
  • Where should I list the order-level offers?

Possible options:

  • Showing item-level offers only on Details page
  • Showing item-level offers only on Cart page
  • Showing order-level offers only on Details page
  • Showing order-level offers only on Cart page
  • Showing item-level offers only on both Details page & Cart page
  • Showing order-level offers only on both Details page & Cart page

How ‘AND’ and ‘OR’ can be combined in advanced twitter search operators?

I want to find tweets including one of these three possibility in search results:

  • AAAA” and “BBBB


  • AAAA” and “CCCC


  • AAAA” and “BBBB” and “CCCC

I mean that AAAA should be in tweets results and one (or both) of BBBB and CCCC should be included too.

How AAAA, BBBB and CCCC should be arranged using one AND operator and one OR operator to get the described result?