Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Join two tables

Status
Not open for further replies.

QUES

MIS
Joined
Dec 19, 2005
Messages
3
Location
US
Hi I write a query based on access database and this program is written is asp.net. In the database, we have tables: One is employee and the other is TimeCheck. I want to select those who are in the Employee table but not in the timeCheck table, so I write my query like this:

strSQL = "SELECT Employee.Name, Timecheck.ServerDate FROM Employee  INNER JOIN TimeCheck ON Employee.idEmployee = timeCheck.idEmployee Where ServerDate = '" & SdateB & "' and Employee.Name NOT in timeCheck"

(NOTE** sdateB is a variable which I defined before and it equals to the text of the textbox entered.)

Error: Syntax error in JOIN operation
Would anyone give me any advice? Thanks in advance!
 
SELECT employee.name, timecheck.serverdate
FROM employee LEFT OUTER JOIN timecheck on employee.idEmployee = timecheck.idEmployee
WHERE serverdate = sDateB AND
timecheck.idEmployee IS NULL

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top