soundcompanies
Perch
I'm having problems with CF to Access and the Like Operator.
The artistID that is passed in is numeric but the values stored are comma separated values.
If I remove the wildcards and the quotes, it will find an exact match, eg.
, but if I have the quotes and the wildcards I get an error, eg.
Here is the error:
The t1.eventArtists is stored as a string so I can't figure why I'm getting an error.
Any ideas?
Thanks,
Brent
Code:
<cfset addEventArtistCrit = "AND ((t1.eventArtists) Like '" & #dbWildCard# & toString(#url.artistId#) & #dbWildCard# & "')">
Code:
<cfquery datasource="#dsn#" name="getEvents">
SELECT t1.EventId
, t1.EventName
, t1.VenueId
, t1.eventActive
, t1.EventDate
, t1.PromoterId
, t1.eventArtists
FROM tblEvents AS t1
INNER
JOIN tblEvents AS t2
ON (t1.VenueId = t2.VenueId) AND (t1.EventDate = t2.EventDate)
WHERE (((t1.EventDate) Between #variable.ODBCstartQueryDate# And #variable.ODBCendQueryDate#)
AND ((t1.eventActive)<>False))
#addEventArtistCrit#
GROUP
BY t1.EventId
, t1.EventName
, t1.VenueId
, t1.eventActive
, t1.EventDate
, t1.PromoterId
, t1.eventArtists
HAVING (((t1.EventId)=Max([t2].[eventID])));
</cfquery>
The artistID that is passed in is numeric but the values stored are comma separated values.
If I remove the wildcards and the quotes, it will find an exact match, eg.
Code:
Like 11
Code:
Like "*11*"
Here is the error:
Data type mismatch in criteria expression
The t1.eventArtists is stored as a string so I can't figure why I'm getting an error.
Any ideas?
Thanks,
Brent