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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Subqueries

Status
Not open for further replies.

WVZ

Programmer
Jan 28, 2002
6
NA
I need assistance to run SQL subqueries. This is a complex job to describe, but I am happy to to email to anybody a copy of the tables with an outline of the problem. This is roughly what I am attempting:

strSQLsub = "SELECT [EmployeeID] FROM [tblEmployees]"

strSQL = "SELECT tblTSHeader.EmployeeID, tblTSHeader.Date, [tblDate].Date, [tblDate].Description, [tblEmployees].EmploymentDate, Weekday([tblDate].Date) AS [Day]"
strSQL = strSQL & "FROM tblDate LEFT JOIN _One ON [tblDate].Date = [_One].Date "
strSQL = strSQL & &quot;WHERE ((([tblDate].Date) < Now()) And (([_One].Date) Is Null) And (([tblDate].Description) Is Null) And ((Weekday([tblDate].Date)) <> 1 And (Weekday([tblDate].Date)) <> 7)) &quot;

My problem comes with the portion where I wish to add something like a DLookup in the middle of the statment to say : &quot;Select the above where the date of employment of this particular employee&quot;

Any suggestions will be most welcome.

Kind regards
Werner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top