I need to 1. convert date into yyyy-mm format, and 2. calculate duration in month from start_date and end_date, e.g. duration = 1 month, ...etc. start_date & end_date are date string in PostgreSQL. I can calculate duration in days and convert date into yyyy-mm format.
For month duration calculation, I don't find to_date() can convert into yyyy-mm format in PostgreSQL. to_char() can show yyyy-mm, but I can't do calculation.
Is there any way, I can convert date into yyyy-mm to do calculation?