Compare fields in Access

Hello,

I'm using to Access to perform my column compares and I'm having some issues. Do you have some recommendations?

I was going to use the nz function but I dont know how reliable it is.

Thanks
lulubell-bAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bryan ButlerCommented:
Please clarify that you are comparing columns in your Access DB tables.  Also, what nz function are you referring to?  (the return value one?)  What is the error/issue you are having?  
0
lulubell-bAuthor Commented:
I'm comparing columns in my access tables. I need to compare data of old vs. new. and I need to see any differences that occurred.

nz([AFTER].[01]))<>([BEFORE].[1])

I'm just unsure if this is the best way to go. I need to compare each column within the table.
0
GRayLCommented:
Nz(After,0)<>Nz(Before,0)
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

GRayLCommented:
BTW, I've found Nz() is very reliable - however, I can't say the same for some of the users ;-)
0
GRayLCommented:
Because you said you are comparing columns in different tables it should look like this

Nz(tblBefore.fld2Compare,0)<> Nz(tblAfter.Fld2Compare,0)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bryan ButlerCommented:
I assume you are looping through result sets using NZ.  But would a query work for you?

select * from before B, after A where B.fld2Compare != A.fld2Comapare
0
Bryan ButlerCommented:
Oh, and you need a key...

select * from before B, after A where B.fld2Compare != A.fld2Comapare  and B.key = A.key
0
GRayLCommented:
'!=' doesn't fly in Access.  

In the Immedidate Pane:

? 1<>2
True
? 1!=2
False
0
Bryan ButlerCommented:
Thanks GRayL.  So:

select * from before B, after A where B.fld2Compare <> A.fld2Comapare  and B.key = A.key
0
lulubell-bAuthor Commented:
Can I perform an outer join with it too? I would like value that do not exist New but existed in the Old

Thanks
0
lulubell-bAuthor Commented:
I also noticed that in the before its lowercase and uppercase in the after.

How do I add the UCASE function to the NZ function?

Thanks
0
lulubell-bAuthor Commented:
I figured out the rest, thank you
0
GRayLCommented:
Thanks, glad to help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.