I am getting min and max dates from text column with query which good people helped me to get there like this :
SELECT max(to_date(nullif(mydatetxt,''), 'DD.MM.YYYY')),
min(to_date(nullif(mydatetxt,''), 'DD.MM.YYYY'))
FROM table_name;
How can I get COUNT of all matched rows between and including min and max dates (written in text column)?
ALTER TABLE table_name ALTER COLUMN mydatetext TYPE date USING (to_date(nullif(mydatetxt,''), 'DD.MM.YYYY'))to turn this into a real date column you can work with sanely.COUNT of all matched rows between and including min and max datesis just count(*) :)