• Hi Flávio,

    If I understand your problem correctly, when DATEDIFF(WW, StartDate, EndDate) > 52, you experience a rollover? (eg 53 => 1)

    I can't seem to replicate your problem, and perhaps a senior here could help out in telling us why this might be happening to you.

    Else, you might want to consider using:

    (DATEDIFF(YY, StartDate, EndDate) * 52) + DATEDIFF(WW, StartDate, EndDate)

    I don't think that this is the best approach to solving your problem and would really like to see what the seniors have to say.