I am trying to filter a wuery using like and a parameter with
LIKE ‘%’ || :User || ‘%’
When doing so, Base asks for the parameter value and then I get a MSSQL error saying that the SQL command has an error near |
How should I go arround this and be able to filter using a parameter?
In case it helps, this is the query I am trying to run, and it seems quite clear to me that the error I am getting is specific to MSSQL:
SELECT TRIM ( "CobroVEstCobro"."IdFinca" ) "IdFinca", "Finca"."Direccion" "Finca", CONCAT( "NomTitular", ' ', "ApellidoTitular" ) "Llogater", CONCAT( "Escalera", ' ', "Piso", "Puerta" ) "Pis", "CobroVEstCobro"."FechaMov" "Data_pagament", "CobroVEstCobro"."FechaExped" "Data_rebut", "CobroVEstCobro"."NumRecibo" "Num_rebut", "CobroVEstCobro"."Importe" "Import", "EstCobro"."Descripcion" "Forma_pagament" FROM "VFIN1"."dbo"."Finca" "Finca", "VFIN1"."dbo"."CobroVEstCobro" "CobroVEstCobro", "VFIN1"."dbo"."EstCobro" "EstCobro", "VFIN1"."dbo"."DepartamentoV" "DepartamentoV", "VFIN1"."dbo"."Inquilino" "Inquilino" WHERE "Finca"."Id_Finca" = "CobroVEstCobro"."IdFinca" AND "EstCobro"."Id_EstCobro" = "CobroVEstCobro"."IdEstCobro" AND "DepartamentoV"."IdFinca" = "CobroVEstCobro"."IdFinca" AND "DepartamentoV"."Id_Depto" = "CobroVEstCobro"."IdDepto" AND "Inquilino"."Id_Inquilino" = "CobroVEstCobro"."IdInquilino" AND "Inquilino"."IdDepto" = "CobroVEstCobro"."IdDepto" AND "Inquilino"."IdFinca" = "CobroVEstCobro"."IdFinca" AND CONCAT( "NomTitular", ' ', "ApellidoTitular" ) LIKE '%' || :Llogater || '%'