SQL Not Equal Query [Resolved By memnoch and apps_tech]
Hi,
I need a sql query but dont know how to write it. I have two table one called Staff and other Contracted_Staff. Now who ever is assigned a contract the StaffId is entered into Contracted_Staff Table, so that way i know which staff is assigned to what contract.
Now on the new contract section i want to select all the Staff from the table Staff who has not been assigned to any contract (available staff in other words). I want to exclude all the Staff who are in Contracted_Staff table. Now i do i go about writing that query.
Thanks for your help.
Danial
PS: Sorry for posting this in General VB, but i really need the answer urgently.
Re: Re: SQL Not Equal Query
Quote:
Originally posted by apps_tech
Try this:
Select * from Staff where staffId Not in ( select distinct staffid from contracted_staff)
Hope this works..do let me know if not...
Enjoy!!!
apps_tech
That worked like a charm !!
Thanks Millions to both memnoch and apps_tech.
Danial
Re: Re: SQL Not Equal Query
Quote:
Originally posted by apps_tech
Try this:
Select * from Staff where staffId Not in ( select distinct staffid from contracted_staff)
Hope this works..do let me know if not...
Enjoy!!!
apps_tech
Sorry, some trouble in my system my answer got posted again...
apps_tech