get all the records from LastValidTech even one of the condition dont match

  • Thread starter mustish1 via AccessMonster.com
  • Start date
M

mustish1 via AccessMonster.com

Hi: I try to print data from LastValidTech even one of the condition
Join/Where dont match. But it shows empty record.

SELECT
LastValidTech.Account1,
LastValidTech.LstVldTech,
tech_id.TECHCONT,
tech_id.CORP,
LastValidTech.ReportID
FROM LastValidTech LEFT JOIN tech_id
ON LastValidTech.LstVldTech = tech_id.TECH
WHERE (((tech_id.CORP)=Val(Left([LastValidTech].[Account1],5))))
GROUP BY
LastValidTech.Account1,
LastValidTech.LstVldTech,
tech_id.TECHCONT,
tech_id.CORP,
LastValidTech.ReportID;

Thanks.
 
M

Marshall Barton

mustish1 said:
Hi: I try to print data from LastValidTech even one of the condition
Join/Where dont match. But it shows empty record.

SELECT
LastValidTech.Account1,
LastValidTech.LstVldTech,
tech_id.TECHCONT,
tech_id.CORP,
LastValidTech.ReportID
FROM LastValidTech LEFT JOIN tech_id
ON LastValidTech.LstVldTech = tech_id.TECH
WHERE (((tech_id.CORP)=Val(Left([LastValidTech].[Account1],5))))
GROUP BY
LastValidTech.Account1,
LastValidTech.LstVldTech,
tech_id.TECHCONT,
tech_id.CORP,
LastValidTech.ReportID;


I think the problem is bevause you are using a LEFT JOIN
instead of an INNER JOIN

Why are you using a GROUP BY clause? Without an aggregate
function, the only thing it accomplishes is to prevent
duplicate output records, which the purpose of the DISTINCT
predicate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Problem in query 1
Help in query 2
Use Instr 1
Can any one please help me out 0
Data shows without input 0
Union two queries 0
Nested query problem 6
Show records even with NULL data? WHERE...IN? 4

Top