Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparison against blank field

Status
Not open for further replies.

BHScripter

Technical User
Aug 26, 2002
159
US
Hi:

I have a csv file that is imported into access as a baseline for comparison against future files.

One of the text type fields comes through blank quite a bit. When a later file is compared against this baseline, if there is now data in that field and I run a query to compare those two fields.

The results don't show the change from blank to populated.

Any thoughts?

Best,
Brianna
 
what is the query you are running to compare the two values?

Leslie
 
Can you please post some relevant code you use giving the unexpected result ?
Seems like an issue with null and empty not being the same thing ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Here is the code
SELECT Baseline.Account, Baseline.[Account Name],
IIf(Baseline.[Account name]<>Current.[Account name],Current.[Account name]," ") AS Name,
IIf(Baseline.[Hold-for Account]<>Current.[Hold-for Account],Current.[Hold-for Account]," ") AS [Hold-for Acct],
IIf(Baseline.[Acct Type]<>Current.[Acct Type ],Current.[Acct Type]," ") AS [Account Type],
IIf(Baseline.[ept Type]<>Current.[ept Type ],Current.[ept Type]," ") AS [ept Typ],
IIf(Baseline.[Offset Account]<>Current.[Offset Account ],Current.[Offset Account]," ") AS [Offset Acct], IIf(Baseline.[Accrual Account]<>Current.[Accrual Account],Current.[Accrual Account]," ") AS [Accrual Acct], IIf(Baseline.[Total Account]<>Current.[Total Account],Current.[Total Account]," ") AS [Total Acct],
IIf(Baseline.Flags<>Current.Flags,Current.Flags," ") AS Flag,
IIf(Baseline.[Memo Notes]<>Current.[Memo Notes],Current.[Memo Notes]," ") AS [Memo Note]
FROM Baseline INNER JOIN [Current] ON Baseline.Account = Current.Account
WHERE (((Baseline.[Account Name])<>[Current].[Account name])) OR (((Baseline.[Acct Type])<>[Current].[Acct Type ])) OR (((Baseline.[ept Type])<>[Current].[ept Type ])) OR (((Baseline.[Offset Account])<>[Current].[Offset Account])) OR (((Baseline.[Accrual Account])<>[Current].[Accrual Account])) OR (((Baseline.[Total Account])<>[Current].[Total Account])) OR (((Baseline.Flags)<>[Current].[Flags])) OR (((Baseline.[Memo Notes])<>[Current].[Memo Notes]));

I tried using "" but what I really want to know is if the field has changed at all - so I need to view the change whether it was blank or populated.

Thanks,
Brianna
 
A starting point:
IIf(Trim(Baseline.[Account name] & "")<>Trim(Current.[Account name] & ""),Current.[Account name],"") AS Name,

and so on, even in the where clause.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top