Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    27

    Unanswered: Newbie help On Sql string form vb

    HI, I just started db programming for this project I am working on. I am having a problem joining two tables where both of their "EmployeeID" fields is equal to my Vb EmpID string....

    I was trying the code:

    SqlQuery = "SELECT TblEmpAttendance.Date, TblEmpAttendance.Value," & _
    "TblEmployees.TotalPoints, TblEmployees.DaysWorked FROM TblEmployees RIGHT JOIN TblEmpAttendance ON TblEmployees.EmployeeID WHERE TblEmpAttendance.EmployeeID" & _
    "= TblEmpAttendance.EmployeeID AND TblAttendance.EmployeeID=" & EmpID


    Any help would be appreciated.
    Thanks
    -Greg S.

  2. #2
    Join Date
    May 2004
    Posts
    27
    Oops I already posted it but ill dbl chk anyhow. I got it to work using:

    SqlQuery = "SELECT TblEmpAttendance.EmployeeID, TblEmpAttendance.Date, TblEmpAttendance.Value," & _
    "TblEmployees.TotalPoints, TblEmployees.DaysWorked FROM TblEmployees RIGHT JOIN TblEmpAttendance ON TblEmployees.EmployeeID = TblEmpAttendance.EmployeeID WHERE TblEmployees.EmployeeID = " & EmpID


    Is their anyhting that could cause problems with this statement?
    Thanks
    -Greg S

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •