A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query question



 
 
Thread Tools Display Modes
  #1  
Old January 26th, 2006, 08:41 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Query question

I am trying to pull data from a database where I want to show only those
records that are the same in 2 fields. For example, I have and Orig field and
an Actual field.
What criteria do I put in that will only show records where these 2 fields
are identical?

Thanks in advance for any help!
  #2  
Old January 26th, 2006, 08:50 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Query question

If you are using QBE to build the query, then in the criteria cell of the
Orig field, put:
= [Actual]

The square brackets are necessary. Without them, Access will assume that
Actual is a text string and surround the field name with quotes.

"Lucien" wrote in message
...
I am trying to pull data from a database where I want to show only those
records that are the same in 2 fields. For example, I have and Orig field
and
an Actual field.
What criteria do I put in that will only show records where these 2 fields
are identical?

Thanks in advance for any help!



  #3  
Old January 26th, 2006, 08:56 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Query question

Field: OriginalField
Criteria: [Tablename].[ActualFieldName]

The brackets are very important. If you leave them out, Access will turn
this into a text string and then will not find a match for
"Tablename.ActualFieldName" OR will complain about a data mismatch.

"Lucien" wrote in message
...
I am trying to pull data from a database where I want to show only those
records that are the same in 2 fields. For example, I have and Orig field
and
an Actual field.
What criteria do I put in that will only show records where these 2 fields
are identical?

Thanks in advance for any help!



  #4  
Old January 26th, 2006, 08:57 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Query question

It doesn't matter which field you use, but for example purposes I will use
Orig. In the criteria row for Orig:
=[Actual]
Your query will then return only those rows where the two fields are equal.

"Lucien" wrote:

I am trying to pull data from a database where I want to show only those
records that are the same in 2 fields. For example, I have and Orig field and
an Actual field.
What criteria do I put in that will only show records where these 2 fields
are identical?

Thanks in advance for any help!

  #5  
Old January 26th, 2006, 09:01 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Query question

I did that and now I receive a message that says:

The expression is typed incorrectly, or is too complex to be evaluated. For
example, a numeric expression may contain too many complicated elements. Try
simplifying the expression by assigning parts of the expression to variables.

Any suggestions?



"Pat Hartman(MVP)" wrote:

If you are using QBE to build the query, then in the criteria cell of the
Orig field, put:
= [Actual]

The square brackets are necessary. Without them, Access will assume that
Actual is a text string and surround the field name with quotes.

"Lucien" wrote in message
...
I am trying to pull data from a database where I want to show only those
records that are the same in 2 fields. For example, I have and Orig field
and
an Actual field.
What criteria do I put in that will only show records where these 2 fields
are identical?

Thanks in advance for any help!




  #6  
Old January 26th, 2006, 09:50 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Query question

I used the Build function to do this so I wouldn't mess it up and it gave me:

= [MasterAvailabilityData].[Actual]

which is the right table and field name....but it still gives me the same
error message.



"John Spencer" wrote:

Field: OriginalField
Criteria: [Tablename].[ActualFieldName]

The brackets are very important. If you leave them out, Access will turn
this into a text string and then will not find a match for
"Tablename.ActualFieldName" OR will complain about a data mismatch.

"Lucien" wrote in message
...
I am trying to pull data from a database where I want to show only those
records that are the same in 2 fields. For example, I have and Orig field
and
an Actual field.
What criteria do I put in that will only show records where these 2 fields
are identical?

Thanks in advance for any help!




  #7  
Old January 26th, 2006, 10:00 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Query question

I think the problem is that the two fields that I am trying to compare have
different format types. One is Number and the other is Text. Could this be
the problem?
I tried to change the data format of one of the fields in the table to match
the other, but it doesn't allow me to do it. It tells me that there is not
enough disk space. I have rebooted my PC and tried it again with no luck.

Is there anything else I can do?



"Lucien" wrote:

I used the Build function to do this so I wouldn't mess it up and it gave me:

= [MasterAvailabilityData].[Actual]

which is the right table and field name....but it still gives me the same
error message.



"John Spencer" wrote:

Field: OriginalField
Criteria: [Tablename].[ActualFieldName]

The brackets are very important. If you leave them out, Access will turn
this into a text string and then will not find a match for
"Tablename.ActualFieldName" OR will complain about a data mismatch.

"Lucien" wrote in message
...
I am trying to pull data from a database where I want to show only those
records that are the same in 2 fields. For example, I have and Orig field
and
an Actual field.
What criteria do I put in that will only show records where these 2 fields
are identical?

Thanks in advance for any help!




  #8  
Old January 26th, 2006, 10:15 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Query question

Open a new query in design mode. Add your Datatable (twice)
You now have DataTable and DataTable_1 in the window
Connect the two key fields
Connect the Orig Field with the Actual Field
save and run the query

Sample sql: (assumes table named DataTable with a Key Field (FieldKey), and
Fields Orig and Actual (of the same type and size)

SELECT DataTable.*
FROM DataTable INNER JOIN DataTable AS DataTable_1 ON (DataTable.Orig =
DataTable_1.Actual) AND (DataTable.FieldKey = DataTable_1.FieldKey);


Ed Warren


"Lucien" wrote in message
...
I am trying to pull data from a database where I want to show only those
records that are the same in 2 fields. For example, I have and Orig field
and
an Actual field.
What criteria do I put in that will only show records where these 2 fields
are identical?

Thanks in advance for any help!



  #9  
Old January 26th, 2006, 10:45 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Query question

Ed, I followed your instructions, and now I get an error message that states:

Type Mismatch in Expression



"Ed Warren" wrote:

Open a new query in design mode. Add your Datatable (twice)
You now have DataTable and DataTable_1 in the window
Connect the two key fields
Connect the Orig Field with the Actual Field
save and run the query

Sample sql: (assumes table named DataTable with a Key Field (FieldKey), and
Fields Orig and Actual (of the same type and size)

SELECT DataTable.*
FROM DataTable INNER JOIN DataTable AS DataTable_1 ON (DataTable.Orig =
DataTable_1.Actual) AND (DataTable.FieldKey = DataTable_1.FieldKey);


Ed Warren


"Lucien" wrote in message
...
I am trying to pull data from a database where I want to show only those
records that are the same in 2 fields. For example, I have and Orig field
and
an Actual field.
What criteria do I put in that will only show records where these 2 fields
are identical?

Thanks in advance for any help!




  #10  
Old January 26th, 2006, 10:54 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Query question

You probably missed the restriction "(of the same type and size)"

The error you are reporting says you do not have the same size and type
fields in your Actual and Orig fields.

Look in table design and verify both fields are the same type (e.g. integer,
double, text) and the same size (number of characters if text, Integer or
Long if numeric)

Ed Warren


"Lucien" wrote in message
...
Ed, I followed your instructions, and now I get an error message that
states:

Type Mismatch in Expression



"Ed Warren" wrote:

Open a new query in design mode. Add your Datatable (twice)
You now have DataTable and DataTable_1 in the window
Connect the two key fields
Connect the Orig Field with the Actual Field
save and run the query

Sample sql: (assumes table named DataTable with a Key Field (FieldKey),
and
Fields Orig and Actual (of the same type and size)

SELECT DataTable.*
FROM DataTable INNER JOIN DataTable AS DataTable_1 ON (DataTable.Orig =
DataTable_1.Actual) AND (DataTable.FieldKey = DataTable_1.FieldKey);


Ed Warren


"Lucien" wrote in message
...
I am trying to pull data from a database where I want to show only those
records that are the same in 2 fields. For example, I have and Orig
field
and
an Actual field.
What criteria do I put in that will only show records where these 2
fields
are identical?

Thanks in advance for any help!






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross tab query construction with Subqueries Steven Cheng Running & Setting Up Queries 7 February 13th, 2006 06:52 PM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Union Query Not Returning A Value Jeff G Running & Setting Up Queries 2 October 19th, 2004 05:47 PM
Big number gives error! Sara Mellen Running & Setting Up Queries 8 October 11th, 2004 02:48 AM
Print Taher Setting Up & Running Reports 1 August 31st, 2004 09:07 PM


All times are GMT +1. The time now is 07:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.