Reputation: 701
how can i select only the records from DB where the Data (Date in portuguese) = the current date
SELECT id, data, dia, mes, ano,fornecedor, doc, valor_líquido, total
FROM public.fluxo_pagamentos where data = current_date;
Upvotes: 4
Views: 14644
Reputation: 1862
cast to date and use now()
SELECT id, data, dia, mes, ano,fornecedor, doc, valor_líquido, total
FROM public.fluxo_pagamentos where data::date = now()::date;
Upvotes: 11
Reputation: 1269853
I may suspect that data
has a time component. If so, try:
where data >= current_date::timestamp and
data < current_date::timestamp + interval '1 day'
Upvotes: 6