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

How to extract the schema of an Access (.mdb) database?
Using loop in a Access Query
Access 2007 Empty Query Quirk
MS Access: How can I automatically reduce Text columns to an appropriate size for the data stored in them?
No max(x,y) function in Access
Why does a report throw an error when the corresponding query doesn't?
Programmatically Search an Access Listbox control's Items Based Off of a Textbox Entry
Auto populate a combobox
How can I add a button to an Access report to export it to Excel / PDF?
Access Caching ODBC connection settings
How to build the search form in ms-access
MS Access 2007 3044 Error
Assigning a Keyboard shortcut to a button in an Access 2007 form
ShellExecute() returns error code 5 when trying to open mdb file >10MB
Disable Check Box Based on Other Values
creating a server project in vb6 and ms-access

Categories

HOME
java
osgi
variables
keycloak
gremlin
mockito
smarty
objectgears
programming-languages
analysis
jsrender
retrofit
azure-storage-tables
qore
android-youtube-api
kibana-4
gnupg
here-api
volttron
jsprit
lombok
libtiff
seaborn
nhibernate-envers
viewport
amazonsellercentral
php-openssl
p-value
underflow
dynamic-featured-image
web-api-testing
large-file-upload
tasklet
google-rich-snippets
google-qpx-express-api
kendo-ui-grid
catch-all
caret
asset-pipeline
mapdb
xenforo
webix-treetable
uft-api
android-tabhost
galen
gulp-sourcemaps
nxlog
netcdf4
azure-application-gateway
filepicker
logparser
dotnetzip
integrity
darcs
r-forge
memory-alignment
redundancy
orthogonal
google-feed-api
spring-android
libpng
transmitfile
merge-conflict-resolution
hill-climbing
essence
testng-dataprovider
hexdump
energy
iad
thredds
marching-cubes
pundit
microbenchmark
composite
truevault
geonetwork
python-green
dia
phalanger
html-helper
zend-route
xojo
openexr
message-driven-bean
typo3-neos
gridfs
apc
ril
jplaton
pygit2
jelly
simba
sublist
bluepill
gdata-api
manchester-syntax
appconkit
amazon-appstore
boost-filesystem
asp.net-mvc-areas
dmx512
revisions
database-management
zend-decorators
private-members
data-acquisition

Resources

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
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App