Olá,
Montei um listview que busca informações da planilha e quero montar alguns filtros.
Ao tentar montar um filtro por data não estou conseguindo que o SQL retorne corretamente os dados!
Podem me ajudar a identificar o que pode ser esse erro?
If ComboBoxPeriodo.ListIndex = 0 Then
Call MontaClausulaWhere(txtAction.Name, "DATE", sqlWhere)
ElseIf ComboBoxPeriodo.ListIndex = 1 Then
Dim vtwelvemonthsaux As Date
Dim vtwelvemonths As Date
Dim NOMECOLUNA As String
vtwelvemonthsaux = Now() - 365
vtwelvemonths = Format(Month(vtwelvemonthsaux) & "/" & Year(vtwelvemonthsaux), "dd/mm/yyyy")
NOMECOLUNA = "OCCURDATE"
sqlWhere = sqlWhere & " " & NOMECOLUNA & " between " & vtwelvemonths & " and " & Format(Now(), "dd/mm/yyyy")
End If
Abraços
Tiago