SQL: fixed format() function with dates