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

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?
Subtract 2 measures as Grand Total in SSAS Cube Browser
Non-aggregated measure in OLAP cube

Categories

HOME
netty
sql-server-2014
compression
cxf
casting
file-upload
esxi
ms-application-insights
download
confluence-rest-api
hibernate-mapping
scapy
android-webview
annyang
cracking
angularjs-ng-repeat
dynamics-crm-2011
ng2-charts
box2d
dat.gui
multibinding
amazon-data-pipeline
url-parameters
openoffice-basic
minimagick
inline-assembly
pumping-lemma
advertising
functional-dependencies
symlink
mongoose-im
hierarchy
foxpro
key-bindings
mplab
loopback
wercker
epub
flickr
microstrategy
android-scrollview
dropdownbox
mootools
strategy-pattern
jibx
stdin
jslider
delphi-xe
file-descriptor
firefox-developer-edition
f#-fake
ack
ocamlbuild
qtwebkit
g77
google-cloud-shell
androiddesignsupport
jtextarea
lightspeed
stringbuilder
turbolinks
racket-student-languages
easy68k
scikit-image
universe
ldd
visual-web-developer
supervised-learning
jde
3d-rendering
boost-propertytree
lytro
persian
consul-template
vspackage
data-representation
valdr-bean-validation
gmaps4jsf
nfa
teamstudio-unplugged
optimistic-locking
diffmerge
api-eveonline
livescript
nsmutableurlrequest
ios-enterprise
im4java
serializer
disabled-control
xpand
reactjs-native
rda
lettuce
ardor3d
friendly-id
tlbimp
nsnumber
android-library
urlfetch
nsregularexpression
invalidoperationexception
derived-class
waveout
states
bindinglist
dancer
diazo
socketasynceventargs
datasheet
advanceddatagrid
ruby-1.9
scsf
cgaffinetransform
log-shipping
flexbuilder
symfony-1.2
hs-err
table-valued-parameters
xslt-grouping
coderush-xpress
ffdshow

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