changed date to SQL.date
tests working