On Mon, 13 Dec 2004 12:36:51 -0600, Nick Baker <[EMAIL PROTECTED]> wrote:
> What is the most efficient way to copy or transfer selected records from
> one table to another table with the same structure?. I.e., all records
> within a certain date range.
> 
> Select and Insert seems be a very laborious method.
> 

<cfquery name="myQuery" datasource="myDSN">
INSERT INTO myNewTable(
 column1,
 column2
)
SELECT column1,
 column2
FROM myOldTable
WHERE date_column >= '01/01/2004'
 AND date_column <= '02/01/2004'
<cfquery>

(I'd use cfqueryparam for the dates, but this is for simplicity-sake.)

Regards,
Dave.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187414
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to