• sharon-472085 (8/28/2014)


    hi,

    trying to build SQL Query to retrieve the data

    sharon

    You haven't given us a lot to go on here but I will take a shot in the dark. I think that what you are trying to do is do something when the value of "flg" changes.

    I would urge you to not use a column as a flag. And by all means why bother abbreviating flag? It is only 4 characters. I would rather use a meaningful name. What does flag represent? Regardless of that I just don't know what you are trying to do.

    every time flag change from 0 to 1 or from 1 to 0

    i need to menipulte value between flg chaging

    I would help but given the above comment I have no idea what you wanting to do.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/