> I'm trying to create a form that, when a button is clicked, will add
> records to a table. Each record of this table has a unique autonumber
> ID, then has a date. I am trying to add 1 month of dates from the last
> date listed in the table (Example: if the last date in the table is Jan
> 31, 2004 then it will need to add a record for each date between Feb 1,
> 2004 and Feb 29, 2004). There is also another table which has a record
> to correspond to each record of the dates table that is tied by the
> intDateID (previously mentioned autonumbered key), so I will need to add
> the necessary records here as well.
>
> My big question is, how would I write my loop for inserting these date
> sequential records? I don't want to just add 30 days because each month
> doesn't have 30 days.
<cfset startdate = '2004-10-31'>
<cfset enddate = DateAdd("m", 1, startdate)>
<cfset currentdate = DateAdd("d", 1, startdate)>
<cfloop condition="currentdate LTE enddate">
blahblahblah
<cfquery ...>
INSERT INTO blahblahblah
</cfquery>
blahblahblah
<cfset currentdate = DateAdd("d", 1, currentdate)>
</cfloop>
Jochem
--
I don't get it
immigrants don't work
and steal our jobs
- Loesje
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

