Fix datetime call in SQLGenerator