This document contains SQL code to normalize billing detail records by month. It declares variables to store IDs, dates and counts. It uses a loop to iterate through billing records, insert normalized records from the start to end date of each record into a table, extending partial months to the end of the month. It then selects fiscal periods between given dates for a client.