how can I remove old quotes that were not been removed after there experation date?
- posted
15 years ago
how can I remove old quotes that were not been removed after there experation date?
You can use this query - ALWAYS MAKE A BACKUP OF DATABASE. In this query you can change the DayBefore = 30 to the number you want like 60 or 90.
Declare @DayBefore Int Set @DayBefore = 30
Begin Transaction
Update [OrderEntry] Set QuantityOnOrder = 0 Where OrderID In (Select ID From [Order] Where Type = 3 And Closed = 0 And Datediff(Day,[Time],Getdate()) > @DayBefore)
Update [Order] Set Closed = 1 Where ID In (Select ID From [Order] Where Type = 3 And Closed = 0 And Datediff(Day,[Time],Getdate()) > @DayBefore)
Commit Transaction
BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.