Quantcast
Viewing all articles
Browse latest Browse all 4871

Query to count based on the value before

Hello,

I am in the middle of an MSSQL query where I want to carry out based on a condition for a person (HR_ID) how many errors made. I attached the current data what I can list out at the moment, based on the attached data I want to print out all the records what are with [PDA_STATUS_CODE]=1000 with the condition that the next record status code text [DESC_RON] contains the text "L3" (like '%L3%') I got the [_CREATION_TIMESTAMP] what I can use for date-time to find out whichone is the next one from the records.

As result I must have the 2 record what I had also attached in my file.

Any help is appreciated!

Thanks

Ervin


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>