2022.1.1.30569 Patch Release Update

The 2022.1.1.30569 Patch/Minor release has been removed from the Download Portal due to a missing signature in some of the included files. This causes the files to not be recognized as valid files provided by Alteryx and might trigger warning messages by some 3rd party programs. If you installed the 2022.1.1.30569 release, we recommend that you reinstall the patch.

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Query bugging with filter

Joker_Hazard
9 - Comet

Hey guys!

My query is bugging! I just want to filter both numbers 4410 and 4412 within this time range. I have to use TRIM before because this field has some whitespaces.

Joker_Hazard_0-1656015496092.png


Is there any way to fix this?

select SDBANCO.VCC_API_EXTRATO_INTERNO.AGENCIA,
SDBANCO.VCC_API_EXTRATO_INTERNO.NUM_CONTA,
SDBANCO.VCC_API_EXTRATO_INTERNO.NUM_CONTA_FORMAT,
SDBANCO.VCC_API_EXTRATO_INTERNO.PRIMEIRO_TITULAR,
SDBANCO.VCC_API_EXTRATO_INTERNO.NOME,
SDBANCO.VCC_API_EXTRATO_INTERNO.DOCUMENTO,
SDBANCO.VCC_API_EXTRATO_INTERNO.TIPO_LANCAMENTO,
SDBANCO.VCC_API_EXTRATO_INTERNO.DATA_LANC_FORMAT,
SDBANCO.VCC_API_EXTRATO_INTERNO.DT_LANCAMEN_FORMAT,
SDBANCO.VCC_API_EXTRATO_INTERNO.ID_HISTORICO,
SDBANCO.VCC_API_EXTRATO_INTERNO.DESC_HISTORICO_SEM_COMPLEMENTO,
SDBANCO.VCC_API_EXTRATO_INTERNO.INSCRICAO,
SDBANCO.VCC_API_EXTRATO_INTERNO.VALOR,
SDBANCO.VCC_API_EXTRATO_INTERNO.TIPO_CC,
SDBANCO.VCC_API_EXTRATO_INTERNO.ID_LANCAMENTO,
SDBANCO.VCC_API_EXTRATO_INTERNO.DATA_LANCAMENTO,
SDBANCO.VCC_API_EXTRATO_INTERNO.CPF_CNPJ_FORMAT,
SDBANCO.VCC_API_EXTRATO_INTERNO.DESC_HISTORICO
from SDBANCO.VCC_API_EXTRATO_INTERNO
where (SDBANCO.VCC_API_EXTRATO_INTERNO.DATA_LANCAMENTO Between To_Date('15/06/2022', 'DD/MM/YYYY') and To_Date('17/06/2022', 'DD/MM/YYYY') and Trim(SDBANCO.VCC_API_EXTRATO_INTERNO.ID_HISTORICO) = '4412' and Trim(SDBANCO.VCC_API_EXTRATO_INTERNO.ID_HISTORICO) = '4410'

5 REPLIES 5
DataNath
12 - Quasar

@Joker_Hazard are they actually numerical fields? If so you may need to wrap the field you get the numbers from in STR() as trim is a string function as far as I’m aware.

HI @Joker_Hazard 

 

I see an opening ( after where clause but I don't seem to find a closing one. No?

grazitti_sapna
15 - Aurora

Hello @Joker_Hazard, could you try removing the highlighted red part?

 

select SDBANCO.VCC_API_EXTRATO_INTERNO.AGENCIA,
SDBANCO.VCC_API_EXTRATO_INTERNO.NUM_CONTA,
SDBANCO.VCC_API_EXTRATO_INTERNO.NUM_CONTA_FORMAT,
SDBANCO.VCC_API_EXTRATO_INTERNO.PRIMEIRO_TITULAR,
SDBANCO.VCC_API_EXTRATO_INTERNO.NOME,
SDBANCO.VCC_API_EXTRATO_INTERNO.DOCUMENTO,
SDBANCO.VCC_API_EXTRATO_INTERNO.TIPO_LANCAMENTO,
SDBANCO.VCC_API_EXTRATO_INTERNO.DATA_LANC_FORMAT,
SDBANCO.VCC_API_EXTRATO_INTERNO.DT_LANCAMEN_FORMAT,
SDBANCO.VCC_API_EXTRATO_INTERNO.ID_HISTORICO,
SDBANCO.VCC_API_EXTRATO_INTERNO.DESC_HISTORICO_SEM_COMPLEMENTO,
SDBANCO.VCC_API_EXTRATO_INTERNO.INSCRICAO,
SDBANCO.VCC_API_EXTRATO_INTERNO.VALOR,
SDBANCO.VCC_API_EXTRATO_INTERNO.TIPO_CC,
SDBANCO.VCC_API_EXTRATO_INTERNO.ID_LANCAMENTO,
SDBANCO.VCC_API_EXTRATO_INTERNO.DATA_LANCAMENTO,
SDBANCO.VCC_API_EXTRATO_INTERNO.CPF_CNPJ_FORMAT,
SDBANCO.VCC_API_EXTRATO_INTERNO.DESC_HISTORICO
from SDBANCO.VCC_API_EXTRATO_INTERNO
where (SDBANCO.VCC_API_EXTRATO_INTERNO.DATA_LANCAMENTO Between To_Date('15/06/2022', 'DD/MM/YYYY') and To_Date('17/06/2022', 'DD/MM/YYYY') and Trim(SDBANCO.VCC_API_EXTRATO_INTERNO.ID_HISTORICO) = '4412' and Trim(SDBANCO.VCC_API_EXTRATO_INTERNO.ID_HISTORICO) = '4410'

Thanks!

Sapna Gupta
Joker_Hazard
9 - Comet

Hey. They are actually string fields. For some reason this database translated those INT to strings. If I filter only 4412 for example, the query works.

Joker_Hazard
9 - Comet

True! For some reason Alteryx put ( right there. Very interesting, I did not pay attention to that. Thanks

Labels