cdemott33
asked on
Help writing t-sql statement checking for a match in tables
I have two table. Table 1 is called eventInformation and table 2 is called onlineOrder. What I need to do is this. I need a list of jobNumbers found in the eventInformation table that have a matching jobNumber in the onlineOrder table. I wrote this...
.. but I don't believe it's working. Can someone tell me how I can fix my code in order for it to give me the results I'm looking for.
Thanks!
SELECT ei.jobNumber
FROM eventInformation AS ei INNER JOIN
onlineOrder AS oo ON ei.jobNumber = oo.jobNumber AND ei.jobNumber = oo.jobNumber
AND ei.arrivalDate BETWEEN '01/01/2011' AND '12/31/2011'
.. but I don't believe it's working. Can someone tell me how I can fix my code in order for it to give me the results I'm looking for.
Thanks!
ASKER
Tried it... but it gives me the same result. I'm reading about sub-queries. Would a subquery work in my case?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>> but I don't believe it's working. <<
So what about it is not "working"?
So what about it is not "working"?
Open in new window