fixed typo to get correct dates into SQL table