Date Records
I need to pull records out that have a date stamp of less than or equal to the past 30 days.My WHERE statement would be what? WHERE lastDateEdited= past 30 days (if LONGER than 30 days, I do not want to include this record into the resultset). Oh CFMX 6.1 and SQL 2000 Thanks in advance. Paul Giesenhagen QuillDesign 417-885-1375 http://www.quilldesign.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: Date Records
cfset dateminus30 = dateAdd(d, -30, now()) then... WHERE lastDateEdited= #CreateODBCDate(dateminus30)# AND lastDateEdited= #CreateODBCDate(now())# Andrew. - Original Message - From: Paul Giesenhagen [EMAIL PROTECTED] Date: Mon, 6 Sep 2004 03:32:33 -0500 Subject: Date Records To: CF-Talk [EMAIL PROTECTED] I need to pull records out that have a date stamp of less than or equal to the past 30 days.My WHERE statement would be what? WHERE lastDateEdited= past 30 days (if LONGER than 30 days, I do not want to include this record into the resultset). Oh CFMX 6.1 and SQL 2000 Thanks in advance. Paul Giesenhagen QuillDesign 417-885-1375 http://www.quilldesign.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Adding Date Records to db
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. Any help is greatly appreciated. Cutter [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Adding Date Records to db
Cutter (CF-Talk) wrote: 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]