Another attempt to fix the sql syntax...