Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / February 2008

Tip: Looking for answers? Try searching our database.

Trying to figure out an effective routine

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
d@by.co.uk - 27 Feb 2008 17:15 GMT
Hi, all
I am trying to figure out an effective routine to comparing a number of
fields (around 20) between two tables (The two tables are identical) the
results would be the record source for a form.
The query below is a example of a routine I have been working with.Names of
tables etc have been cut down
SELECT T1.ID, “HD" AS [CF], T2.[HD] AS [CF]
FROM T1 INNER JOIN T2 ON T1.ID = T2.ID
WHERE (((T1.[HD])<>[T2].[HD]))
I have been thinking along the lines of making “HD" and [HD] into string
variables and then looping with a new field name etc until end of records.
Any help in achieving this or alternative approaches would be most
appreciated
John Spencer - 27 Feb 2008 17:40 GMT
Are you trying to display more than one field at a time?
How do you want to handle Null in table1 and Value in Table2 (or the other
way round)?
How do you want to handle Null in both tables?

Can you give an example record of the desired output you want?  Do you just
want to know the field contents are different or do you want to display the
field contents if they are different?

HDNoMatch: IIF(T1.HD is Null and T2.HD is Null, Null,
IIF(T1.HD=T2.HD,Null,"DIFF"))

Or if the values are important to display
HDNoMatch: IIF(T1.HD is Null and T2.HD is Null, Null,
IIF(T1.HD=T2.HD,Null,T1.HID & " : " & T2.HD))

Signature

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
.

> Hi, all
> I am trying to figure out an effective routine to comparing a number of
[quoted text clipped - 10 lines]
> Any help in achieving this or alternative approaches would be most
> appreciated
d@by.co.uk - 27 Feb 2008 19:36 GMT
That you for the reply John

The form I have designed at the moment to take the test data from the
example query

Displays:-

The name of the field that has changed

The original data field from table1
The changed data field from table2

I will only be displaying data that has changed from the targeted fields
(around 20) so I did not think that nulls would be an issue
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.