Thank you both for your suggestions I solved the problem through changing format of the string to a date variable via the input function, and then used the intck function + an extra variable to select the right interval. @PGstats I learned something new from you! Thanks /Petter
... View more