I have a query that creates a list of dates
<cfoutput query="checkForOverlap">
<cfset overlapRecordCount=
ListAppend(overlapRecordCount,DateFormat(myStart,"mm/dd/yyyy"))>
<cfif DateFormat(myStart,"mm/dd/yyyy") gte
DateFormat(finalDay,"mm/dd/yyyy")>
<cfbreak>
</cfif>
</cfoutput>
I want to use this list in an SQL query:
<cfquery name="other_query" dbtype="query">
SELECT *
FROM main_query
WHERE (myStart BETWEEN
<cfqueryparam cfsqltype="CF_SQL_TIMESTAMP"
value="#formattedBeginDay#"> and
<cfqueryparam cfsqltype="CF_SQL_TIMESTAMP"
value="#formattedEndDay#">)
AND myStart NOT IN (#overlapRecordCount#)
ORDER BY myStart
</cfquery>
The problem is obvious in that the single quotes are not wrapped around each
element in the list when the IN is performed. Are there any CF string
functions I can try to wrap the dates in the list with single quotes?
Many thanks!
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Re: Date list using SQL IN operator Levenson, Keith
- Re: Date list using SQL IN operator Keith Levenson