Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 31st, 2007, 11:24 PM
Authorized User
 
Join Date: May 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default ms access query

hi
we have to table named "tmpteacher" and "tmpteacher1" .we have to get record which is not common in both table.the query which we trying is :

SELECT tmpteacher1.* FROM tmpteacher INNER JOIN tmpteacher1 ON (tmpteacher.tc<> tmpteacher1.tc);

for = to condition its working.for <> not working .
we are running this query in ms access .

Please suggest possible answer:(

 
Old June 1st, 2007, 10:27 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Try
Code:
SELECT tmpteacher1.*  
FROM   tmpteacher1 
WHERE  tmpteacher1.tc NOT IN (SELECT DISTINCT tmpteacher.tc
                              FROM   tmpteacher)


Joins really are for showing as one result set the columns from more than one data source (table, query, etc.)

In your case, you are trying to limit the records from one table according to the relationship of that table’s data to the data in a different table.





Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access Query neha2007 SQL Language 1 July 12th, 2007 10:11 AM
MS Access Query rsm42 ASP.NET 1.0 and 1.1 Basics 2 March 20th, 2007 12:32 PM
I am trying to convert a MS Access Query to a SQL? WebLadyBug SQL Server ASP 3 March 9th, 2007 12:39 PM
MS Access Query sunny76 Access 4 October 18th, 2006 06:54 AM
Ms Access stored query problem turker Classic ASP Databases 0 December 27th, 2005 01:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.