Código: Selecionar todos
select * from Tabela where year(data) = 2020 and month(data) = 12a percorrer a tabela testando cada registro?
Grato,
Moderador: Moderadores
Código: Selecionar todos
select * from Tabela where year(data) = 2020 and month(data) = 12
Depende...tchadrack escreveu:Existe alguma forma ou sou obrigado
a percorrer a tabela testando cada registro?
Código: Selecionar todos
INDEX ON DtoS (data) TO idxData Código: Selecionar todos
USE tabela SHARED NEW INDEX idxData
DbSeek ( "202012", .T. ) // Soft seek
DO WHILE .NOT. Eof() .AND. Left (DtoS(data), 6) == "202012"
// comandos...
tabela->( DbSkip () )
ENDDO
tabela->(DbCloseArea ())
RETURN
Código: Selecionar todos
SET SCOPE TO "202012"
GOTO TOP
DO WHILE ! Eof()
SKIP
ENDDO


Código: Selecionar todos
set filter to Year(data)=2020 and month(data)=12