Home Forums SQL Server 2008 SQL Server Newbies Delete statement suggestion that will help me fix my statement RE: Delete statement suggestion that will help me fix my statement

  • mistylove98 (4/23/2015)


    Thanks all for the help I feel kinda stupid now. Yes it should not have been shipped date it should have been

    delete LMOrders where OrderDate between 10-10-1996 and 10-25-1996 and ShipVia = 2

    because 2 is the company united package

    but now i ran into a problem where it says 0 rows affected when I know there are 6 rows with this data

    The problem is with the way you are specifying your dates. Lynn has already mentinoed it previously.

    They need to be '19961010' and '19961025' (with the quotes).

    As you've written it above (without quotes) 10-10-1996 will be evaluated as an arithmetic expression resulting in the value -1996, converting this to a date gives the "15 July 1894" . Not quite what you meant I'm sure 🙂