I take two dates from the db start and end, and find all dates in this range, and return so
09/02/2007,09/03/2007,09/04/2007,09/05/2007,09/06/2007,09/07/2007,09/08/2007
Then I grab what is in already in the field that I want to combine this with.
11/15/2007,10/25/2007,10/26/2007,10/27/2007
To make
11/15/2007,10/25/2007,10/26/2007,10/27/2007,09/02/2007,09/03/2007,09/04/2007,09/05/2007,09/06/2007,09/07/2007,09/08/2007
Comma Delimited dates, then put it back into the database.
How can I do this, this is what I have so far, but I get a string and put a string back into the database, not comma delimited dates.
<cfquery name="getRecord" datasource="#request.dsn#">
SELECT TOP 1 *
From Reservations
WHERE f_name = '#Form.f_name#' and l_name = '#Form.l_name#' and zip = #Form.zip#
ORDER BY ID DESC
</cfquery>
<cfquery name="getThisRecord" datasource="#request.dsn#">
SELECT arrive, depart
From Reservations
WHERE ID = #getRecord.ID#
</cfquery>
<cfoutput>#getThisRecord.arrive# - #getThisRecord.depart#</cfoutput>
<cfquery name="Pending" datasource="#request.dsn#">
Select d_pending
From calendar_dates
WHERE P_ID = #url.ID#
</cfquery>
<cfoutput>
<cfparam default="" name="update">
<cfloop from="#getThisRecord.arrive#" to="#getThisRecord.depart#" index="i">
<cfset update = '#update#,#dateformat(i, "mm/dd/yyyy")#'/>
</cfloop>
<cfset d_pending = '#pending.d_pending##update#' />
#d_pending#
</cfoutput>
Any Ideas?
09/02/2007,09/03/2007,09/04/2007,09/05/2007,09/06/2007,09/07/2007,09/08/2007
Then I grab what is in already in the field that I want to combine this with.
11/15/2007,10/25/2007,10/26/2007,10/27/2007
To make
11/15/2007,10/25/2007,10/26/2007,10/27/2007,09/02/2007,09/03/2007,09/04/2007,09/05/2007,09/06/2007,09/07/2007,09/08/2007
Comma Delimited dates, then put it back into the database.
How can I do this, this is what I have so far, but I get a string and put a string back into the database, not comma delimited dates.
<cfquery name="getRecord" datasource="#request.dsn#">
SELECT TOP 1 *
From Reservations
WHERE f_name = '#Form.f_name#' and l_name = '#Form.l_name#' and zip = #Form.zip#
ORDER BY ID DESC
</cfquery>
<cfquery name="getThisRecord" datasource="#request.dsn#">
SELECT arrive, depart
From Reservations
WHERE ID = #getRecord.ID#
</cfquery>
<cfoutput>#getThisRecord.arrive# - #getThisRecord.depart#</cfoutput>
<cfquery name="Pending" datasource="#request.dsn#">
Select d_pending
From calendar_dates
WHERE P_ID = #url.ID#
</cfquery>
<cfoutput>
<cfparam default="" name="update">
<cfloop from="#getThisRecord.arrive#" to="#getThisRecord.depart#" index="i">
<cfset update = '#update#,#dateformat(i, "mm/dd/yyyy")#'/>
</cfloop>
<cfset d_pending = '#pending.d_pending##update#' />
#d_pending#
</cfoutput>
Any Ideas?