sql date & time types + fixes