General information
Forum:
Microsoft SQL Server
Title:
Select into a table
Hi,
I have a select statement that returns a number of columns and rows. I would like to insert these rows into a resident table.
Here is an example of what I am trying to do:
SELECT Number,CreatedDate,OrderedDate,OrderCompletedDate
,(CASE WHEN (Number LIKE 'S-%' OR Number LIKE '%-C%')
THEN DATEDIFF(dd,CreatedDate,OrderCompletedDate)
ELSE
DATEDIFF(dd,OrderedDate,OrderCompletedDate)
END) as TurnAroundTime,
Status
FROM AroundTime
WHERE OrderedDate BETWEEN '08/01/2003' AND '10/10/2003'
AND Number LIKE 'TO%'
ORDER BY Number
How can I get the returned data into the resident table?
Thanks,
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only