If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Compare fields in query
SQL dummy needs help. What's the syntax for a query that
will output records where tblParts.TgtThick does not equal tblParts.ActThick. In this case its a number field but I see where I might need to compare text fields as well. Thanks for the help. |
#2
|
|||
|
|||
Hi ds,
What you have to do is put tblParts into the query *twice* and join tbpParts.TgtThick to tblParts.ActThick. The syntax should look something like: SELECT DISTINCTROW tblParts.* FROM tblParts LEFT JOIN [tblParts_1] ON tblParts.TgtThick = [tblParts_1].ActThick WHERE ((([tblParts_1].ActThick) Is Null)); hth, LeAnne ds wrote: SQL dummy needs help. What's the syntax for a query that will output records where tblParts.TgtThick does not equal tblParts.ActThick. In this case its a number field but I see where I might need to compare text fields as well. Thanks for the help. |
#3
|
|||
|
|||
Seems like an awfully simple query.
SELECT TblParts.* FROM TblParts WHERE TblParts.tgtThick tblParts.ActThick So the questions that arise a Is this homework? Is there more to the problem? ds wrote: SQL dummy needs help. What's the syntax for a query that will output records where tblParts.TgtThick does not equal tblParts.ActThick. In this case its a number field but I see where I might need to compare text fields as well. Thanks for the help. |
#4
|
|||
|
|||
Yes, in the case of my text field an expression is being
used to concatenante fields from a different table: SELECT tblMfg.SampleID, CombineChildRecords ("qryComposition","MaterialType","PartID",[PartID],",") AS Composition FROM tblMfg then I want WHERE Composition tblMfg.CComposition but I get prompted for Composition. -----Original Message----- Seems like an awfully simple query. SELECT TblParts.* FROM TblParts WHERE TblParts.tgtThick tblParts.ActThick So the questions that arise a Is this homework? Is there more to the problem? ds wrote: SQL dummy needs help. What's the syntax for a query that will output records where tblParts.TgtThick does not equal tblParts.ActThick. In this case its a number field but I see where I might need to compare text fields as well. Thanks for the help. . |
#5
|
|||
|
|||
AHH!
Then you will need to re-calculate the value in the where clause. I _believe_ that Access won't allow you to use the alias for the field in the where clause. SELECT tblMfg.SampleID, CombineChildRecords ("qryComposition","MaterialType","PartID",[PartID],",") AS Composition FROM tblMfg WHERE CombineChildRecords("qryComposition","MaterialType ","PartID",[PartID],",") tblMfg.CComposition ds wrote: Yes, in the case of my text field an expression is being used to concatenante fields from a different table: SELECT tblMfg.SampleID, CombineChildRecords ("qryComposition","MaterialType","PartID",[PartID],",") AS Composition FROM tblMfg then I want WHERE Composition tblMfg.CComposition but I get prompted for Composition. -----Original Message----- Seems like an awfully simple query. SELECT TblParts.* FROM TblParts WHERE TblParts.tgtThick tblParts.ActThick So the questions that arise a Is this homework? Is there more to the problem? ds wrote: SQL dummy needs help. What's the syntax for a query that will output records where tblParts.TgtThick does not equal tblParts.ActThick. In this case its a number field but I see where I might need to compare text fields as well. Thanks for the help. . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unmatched Query: Memo Fields | Bernie | Running & Setting Up Queries | 1 | August 22nd, 2004 03:19 PM |
query to create fields | tony wong | Running & Setting Up Queries | 2 | June 29th, 2004 10:36 PM |
Fields not on form after ammending query | Ronnie | Using Forms | 1 | June 6th, 2004 01:11 AM |
COMPARE THE TWO TABLES | Stefanie | General Discussion | 0 | June 4th, 2004 04:36 PM |
surely a form with a ListBox can be used in a query? | 1.156 | Running & Setting Up Queries | 14 | June 2nd, 2004 04:54 PM |