Not equal

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

mike via AccessMonster.com

Hi,

How can i query a table that will select only for those two tields are not
equal.

ex.
Table1

stockno description field1 field2
1 tools 40 30
2 box 30 60
3 paper 20 10
4 towel 15 15

I want my query result to display only the stockno 1,2 & 3 'coz those are not
equal in field1 & field2.
 
R

Rick B

Create an unmatched query. When you select "New Query" you can run the
"Find Unmatched Query Wizard".
 
C

Chaim

SELECT * FROM [Your Table]
WHERE [field1] <> [field2];

In the QEB,

Drag '*' to grid with no criteria. Drag field1 to grid, set Show to blank,
and set Criteria to
'<> [field2]'

Good Luck!
 
M

Michel Walsh

Hi,


SELECT * FROM myTable WHERE field1 <> field2


That is the SQL statement produced behind the scene. Switch back in design
view to see what could have been done, graphically, to produce it, there.



Hoping it may help,
Vanderghast, Access MVP
 
M

mike via AccessMonster.com

thanks

Michel said:
Hi,

SELECT * FROM myTable WHERE field1 <> field2

That is the SQL statement produced behind the scene. Switch back in design
view to see what could have been done, graphically, to produce it, there.

Hoping it may help,
Vanderghast, Access MVP
[quoted text clipped - 13 lines]
not
equal in field1 & field2.
 
M

mike via AccessMonster.com

thanks
SELECT * FROM [Your Table]
WHERE [field1] <> [field2];

In the QEB,

Drag '*' to grid with no criteria. Drag field1 to grid, set Show to blank,
and set Criteria to
'<> [field2]'

Good Luck!
--

Chaim
[quoted text clipped - 12 lines]
I want my query result to display only the stockno 1,2 & 3 'coz those are not
equal in field1 & field2.
 
M

mike via AccessMonster.com

thanks
SELECT * FROM [Your Table]
WHERE [field1] <> [field2];

In the QEB,

Drag '*' to grid with no criteria. Drag field1 to grid, set Show to blank,
and set Criteria to
'<> [field2]'

Good Luck!
--

Chaim
[quoted text clipped - 12 lines]
I want my query result to display only the stockno 1,2 & 3 'coz those are not
equal in field1 & field2.
 
M

mike via AccessMonster.com

this one is good it works ,,,thanks a lot
SELECT * FROM [Your Table]
WHERE [field1] <> [field2];

In the QEB,

Drag '*' to grid with no criteria. Drag field1 to grid, set Show to blank,
and set Criteria to
'<> [field2]'

Good Luck!
--

Chaim
[quoted text clipped - 12 lines]
I want my query result to display only the stockno 1,2 & 3 'coz those are not
equal in field1 & field2.
 
Top