ms-access


Mark Duplicate in Access


I would like to write a query in Access 2013 to mark the first time a word appears as "Yes" and all subsequent times as "No". I have included a sample below. The "Distinct" column is what I would like my query to generate.
Thank you
Word Distinct
First Yes
Second Yes
First No
Third Yes

Here is one approach:
SELECT *, IIf(DMin("ID","Table1","[Word]='" & [Word] & "'")=[ID],"Yes","No") AS FirstWord
FROM Table1;
Another:
SELECT *, IIf([ID] = (SELECT TOP 1 ID FROM Table1 AS Dupe WHERE Dupe.Word = Table1.Word ORDER BY Dupe.Word, Dupe.ID), "Yes", "No") AS FirstWord FROM Table1;
DISTINCT is a reserved word so I am avoiding using it as a field name.


Related Links

Access Navigation Control BrowseTo "The command or action 'BrowseTo' isn't available now. Error 2046
Add a record (that does not already exist) to a table from a userform
Access 2010 report invoice total
linked table xxx is unavailable. Microsoft access cannot contact the server
Does this Dlookup have incorrect syntax?
How to combine two fields in Form to one field from Microsoft Access?
Report building from selection in datasheet
Multiple arguments IsNull function MS Access VBA
how to pass parameters to ExportWithFormatting using vbscript
Access 2010 cascading combo boxes runtime error 424
Access Month Calendar View
Shapefile to MDB with custom field structure [duplicate]
Query JET 4 database with SSIS
Microsoft Access 2010: Query Criteria moving
Is there a way to create an Access database from a Visio database model?
Access: insert multiselect box values into database

Categories

HOME
cakephp
hive
asp.net-core
hook
omnet++
zeromq
google-api-php-client
tinymce
maven-3
retrofit
blueprintjs
flyway4
qore
android-youtube-api
add
amazon-cloudformation
python-unittest
gorm
wheelnav.js
dax
timeout
spring-tool-suite
size
dynamics-crm-online
netflix
seaborn
sms-gateway
contextmenu
google-cloud-speech
jprofiler
plunker
captiveportal
microsoft-r
smb
selectedindexchanged
intel-pin
delicious-api
gsoap
media-queries
junit5
asset-pipeline
atl
jmonkeyengine
file-format
serve
opshub
vao
smartcontracts
upstart
pnotify
git-diff
setter
composite-key
capacity
spring-cache
bind9
redundancy
chord-diagram
xcb
setuptools
gridpane
home-directory
multi-level
trash
hexdump
natvis
kendonumerictextbox
separator
responsive-images
sysinternals
oberon
dd
qpainter
rdtsc
p4java
kgdb
dealloc
message-driven-bean
html5-notifications
odata4j
file-locking
gwt-rpc
html4
jelly
free-variable
manchester-syntax
window-management
psi
xmlspy
w3wp.exe
preference
vc90
fixed-width
adrotator
nerddinner
w3wp





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm