Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate field query 1

Status
Not open for further replies.

Xzibit7

Technical User
Jun 20, 2006
172
US
I have a table "tblDevice" which has a field "CBID#" which has duplicate entries. I am trying to count the number of duplicates for each CBID# and then just make a table that just shows the individual CBID#'s and each ones number of duplicates.

I have used the SQL statement

Select CBID#, count(*) From tblDevice group by CBID#


This however does not work as I always get "a syntax error in date in query expression CBID#" message. Any help would be appreciated. Thanks
 
Try wrapping CBID# in brackets as it's a field with a special character in the name, e.g.
Code:
[CBID#]
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Thanks I ended up justing taking out the # sign and it worked perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top