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 / September 2005

Tip: Looking for answers? Try searching our database.

duplicate query within an If statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alan - 17 Sep 2005 13:13 GMT
Hello All

I have a data base which I have inherited and Im trying to sort ...
In my data base I have an employee number which is unique to the individual,
however over time this has been 'overlooked' and now Im using a data base I
would hope to have this as the Primary key ...
The problem is ... some records have been created with no employee number,
wrongly entered employee number, something totally spurious and finally
entered more than once.

I have done the provided Duplicate query and confirm 100+ duplicates. I
figured for analysis purposes that I would create another colum on my master
table which would provide a defined output depending on the error which would
subseqently become searchable, however I cant fathom how to use the duplicate
query within the If statement ... My code so far is

EmpNoStatus: IIf((IsNull(PERSONNEL![Employee No])),"NO
EMPNO",IIf((Len(PERSONNEL![Employee No])<6),"INVALID","OK"))

I think I need to replace the OK with another If loop for duplicates

Any help would be grateful

Regards
peregenem@jetemail.net - 19 Sep 2005 08:38 GMT
> EmpNoStatus: IIf((IsNull(PERSONNEL![Employee No])),"NO
> EMPNO",IIf((Len(PERSONNEL![Employee No])<6),"INVALID","OK"))
>
> I think I need to replace the OK with another If loop for duplicates

'Loop' is the wrong mental model. Think in terms of sets. If you want
to include another set (e.g. your set of duplicates) in your resultset,
use UNION.
 
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.