Only selecting records where row_created is  >=08/01/2012 - TSQL

Posted on 2012-08-30
Last Modified: 2012-08-30
I am trying to select records where the row_created is >= 08/01/2012.

I have coded this statement but it is nto eliminating any records.

row_created>={ts '2012-08-01 00:00:00'}
Question by:morinia
    LVL 16

    Assisted Solution

    select * from tablename where row_created >= '2012-08-01'

    Open in new window

    should be ok.
    LVL 65

    Accepted Solution

    >I am trying to select records
    >it is nto eliminating any records.
    Which is it you wish to do, select (i.e. show) records, or delete (kill, destroy) records?

    -- This selects rows where the value in the row_created column is greater than or equal to '08/01/2012'
    SELECT *
    FROM YourTable
    WHERE row_created >= '2012-08-01'

    -- This deletes those records from the table permanently
    FROM YourTable
    WHERE row_created >= '2012-08-01'

    Author Closing Comment

    Thanks Guys,

    Don't kill me but the problem was I had a union statement and put the statement at the end of only one of the selects not both .   DUUUUUUUH

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    This is my first ever Article on EE or elsewhere; therefore, please bear with me if I have some discrepancies in my writing. I read many articles and questions related to "how to pass values to SSIS packages at run-time?"  Hence, this common ques…
    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
    Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now