• parikiti (4/12/2013)


    sorry for the late reply...

    Case 1:the first column can be considered as first one and also there is a time assigned when the that particular row was created like 04/01/2013 6:30:00AM ...something along those lines

    Case 2: i emant when we are comparing two rows with the same customer name and also those rows if they have same createdBy like in the sample Cris is repeated as the one who created that row...

    example :

    RowID CustomerName CustomerID CreationDate CreatedBy Validation

    row 1 Vam 000245 04/01/2013 6:30:00am Cris

    row 2 Vam 000245 04/01/2013 7:45:00am Cris

    These two have the same customerName and same CreatedBy then the difference between the CreationDate should be greater Than the Lock_Count Value which we get from Table ParametersB.

    After the process is done The CustomerA should like this

    RowID CustomerName CustomerID CreationDate CreatedBy Validation

    1 Vam 000245 04/01/2013 Cris 8(as this was created first)

    2 Vam 000245 04/01/2013 cris 9(a row exists for time frame)

    3 Vam 000245 04/02/2013 cris 8(first row for new time frame)

    4 Vam 000245 04/01/2013 ted 9(Already exists and different created by)

    8-Means that row is valid;

    9-Means that row is invalid

    hope this helps

    I don't why but I will try one more time. This is totally unclear.

    These two have the same customerName and same CreatedBy then the difference between the CreationDate should be greater Than the Lock_Count Value which we get from Table ParametersB.

    This makes no sense. The difference between the CreationDates? I get there are two rows and the difference needs to be greater than 1. But what are we using to calculate the difference? DATEDIFF? What unit of time are we using? I am totally unable to figure out what you are asking. Put yourself in my shoes and ask yourself if you could answer the question based on what is posted.

    _______________________________________________________________

    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/