something like.... CASE WHEN (dbo.myOtherTable.fieldC <> 0) dbo.myOtherTable.fieldC ELSE dbo.myOtherTable.fieldD END
On 2/17/06, Duane Boudreau <[EMAIL PROTECTED]> wrote: > Is there anyway of doing an if/else statement inside an insert clause, > something like? > > > > > > Insert dbo.myTable (x,y,z) > > > > Select dbo.myOtherTable.fieldA, dbo.myOtherTable.fieldB, > > if (dbo.myOtherTable.fieldC != 0) dbo.myOtherTable.fieldC else > dbo.myOtherTable.fieldD > > > > From dbo.myOtherTable > > > > Where dbo.myOtherTable.fieldN = 1 > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2431 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
