bug 2703: Changed spent.pl select statment to include joins between tables.