Left joins and is nulls (1 Viewer)

Charlie

Registered User.
Local time
Today, 20:01
Joined
Jan 7, 2000
Messages
16
Dear Fellow Accessers,

Hi, I'm making a database to store the sales data from our sales departments. I have a very large table with all the staff past and present and a query that shows me which of these staff are actually working for us now.

My problem is that not all of these staff have sales targets. I'm trying to make a query that will show me all the targets for the staff that are working this month even if they haven't got a target. I use a left join so that the CurrentStaff is on the left and the StaffTargets is on the right. For this month we have 44 staff of which 25 have targets but my left joining query only shows me 39 staff! I've done an 'unmatched' query and at least this shows me the staff that aren't included this month.

The second thing is that I've heard that SQL has a function that will replace a null value that looks something like this: IsNull( MyVar, 0 ) which ought to replace a null with a 0. However this doesn't work and it complains that I'm using too many variables. Is there a way to do this??

Thanks a lot,

Charlie
 

KMAN

New member
Local time
Today, 20:01
Joined
May 2, 2000
Messages
8
The function you want is
NZ(<field>,<value_if_Null> )
 

Users who are viewing this thread

Top Bottom