aggregate-functions


duplicate query on concatenated field


I have a concatenated query field (query name: datqry_SampleNumber) that is based on data from 3 different tables to create a unique SampleCode as follows
(SampleCode: IIf([tbl_Carcass.SampleNumber]="-999","-999","NPT-" & [tbl_SurveyInfo.SurveyYear*] & "-" & [datqry_TransectData.Project_Code] & "-" & [tbl_Carcass.SampleNumber])
for SampleNumber values > 0001 (-999 is a placeholder indicating no SampleNumber assigned). Note, SurveyYear* is a calculated field based on Survey Date.
So, since SampleCode needs to be unique to each sample, I am trying to build a duplicate query, based on the aforementioned query, to identify duplicate SampleCodes so they can be relabeled and archived w/ a unique qualifier. The criteria for the duplicate query operation is as follows
In (SELECT [SampleCode] FROM [datqry_SampleNumber] As Tmp GROUP BY [SampleCode] HAVING Count(*)>1 )
However, I get the following error message..."Your query does not include the specified expression 'SampleCode' as part of an aggregate function." I've looked into aggregate functions and have tried various ways to GROUP BY using the individual data fields that make up the code but I can't seem to get anything to work.
Any ideas on how to tackle this problem? Thank you in advance for your help and suggestions.

Related Links

Necessity of declaration of function in c and cpp
Calculate window average in tableau
Complexity asymptotic relation (theta, Big O, little o, Big Omega, little omega) between functions
What are TOP_COUNT and TOP_MAXCOUNT in BigQuery?
marklogic need advise for approach to aggregate documents
multiply(num) aggregate function in postgresql
Binding the Result of an Aggregate Function to a Projected Variable
tableau aggregate data based on dimension
where clause and aggregate functions
Is there such a thing as a join() aggregate function that concatentates field values at a specific character?
Aggregation of an expression in Django query spanning multiple tables
How to aggregate / roll up percentile measures
A peer-to-peer and privacy-aware data mining/aggregation algorithm: is it possible?
Multiple aggregates in SPARQL
SAP BO XI Desktop Intelligence Aggregate Calculations
Mondrian: Help picking the right aggregator for Measures?

Categories

HOME
classification
logging
gulp
stanford-nlp
service
python-requests
android-ndk
latex
spotfire
mediarecorder
powerquery
atlassian-fisheye
gnuradio
liquidsoap
segmentation-fault
aspectj
opengrok
aggregate
sha1
web-worker
airbnb
android-wifi
include-path
rndis
gsuite
ppp
sha
core-animation
launchd
git-submodules
pypy
r-factor
ocl
webspeech-api
webclient
odp.net
rtsp
mapquest
ssdp
definition
apiman
wufoo
automapper-4
openxava
monaca
e4
perldoc
activesupport
opticalflow
scrollmagic
catalyst
huawei
easy-thumbnails
glade
ldd
netlink
key-value-store
patching
jmh
video-embedding
jersey-test-framework
datamodel
bluetooth-lowenergy-4.2
videoview
dynamics-nav-2013
app-data
updating
esb-toolkit-2.1
jeet-grid
caption
iphone-6
conditional-comments
api-eveonline
django-tests
internet-radio
pthreads-win32
netbeans-plugins
lastinsertid
xml-validation
kohana-orm
typography
qgraphicsscene
infinity.js
setcookie
qt5.1
volatility
big-endian
hypertable
github-archive
facebook-winjs-sdk
stl-algorithm
joomla1.7
sessiontracking
hwnd
xcdatamodel
arraycollection
newspeak
uccapi
lts

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