So, I have a query that looks for duplicate song titles in a Songs database. but since punctuation can sometimes obscure these matches (i.e., "Baby, I love you" and "Baby I love you"), I created a function that strips out all punctuation. Then I created a query that gets everything from Songs and adds in the punctuation-less title. But when I query that altered title, StrippedTitle, I get the error "data type mismatch in criteria expression." Can anyone tell me why?
Query that generates the "data type mismatch" error:
Code:
SELECT StrippedTitle
FROM StrippedSongs
GROUP BY StrippedTitle, Member
HAVING (Count(StrippedTitle)>1);
StrippedSongs query (which calls Function StripPunctuation, which returns a String):
Code:
SELECT StripPunctuation([Title]) AS StrippedTitle, Songs.SongID, Songs.Title, Songs.Excerpt, Songs.Notes, Songs.Composer_id, Songs.Member
FROM Songs;
Songs table:
Code:
SongID AutoNumber
Title Short Text
Excerpt Short Text
Notes Long Text
Composer_id Number
Member Number
The query off of Songs that I'm trying to replace with the query to StrippedSongs:
Code:
SELECT Title
FROM Songs
GROUP BY Title, Member
HAVING (Count(Title)>1);