Code:
SELECT Count(a.[whateverfieldyouwant]) as [ANameifyouwant]
FROM StaffTbl as a
INNER JOIN [the date table] as b
ON a.StaffID = b.StaffID
WHERE b.CommenceDate <= '01/07/2010' or Textbox1.Text
If above is the kind of thing you are doing, and it is correct (I.e it works without the date part) then it *must* be either the date field is not in the correct format.
Or the textbox/field in which the person enters data doesn't correctly convert the date across.
Not sure, but do you have to set the format of the textbox/report/field in which you are inputting data? (allowing a certain type? like nvarchar/datetime etc)
These are my guesses, I might be wrong so hopefully other people will suggest ideas if i'm incorrect.
Good luck.
Rixxe.