Extraction Value Question

Hey everyone,

I feel very silly for asking this question, as it seems so simple, but here we go.

I would like to be able to set up an extraction that can be run once a month that always grabs constituents whose memberships expire next month. I thought I could do this by setting up two criteria in the extraction:

Membership Exp Date >= BRunMonths +1

Membership Exp Date <= ERunMonths +1

I expected that when I ran this extraction today (in November), that this would grab all memberships that expire between December 1, and December 31. However, what I'm finding is that it only pulls memberships that expire between December 1- December 30th. I suppose that's because November only has 30 days, so what the query is doing is taking 11/1 and 11/30 and changing them to 12/1 and 12/30. But this is definitely not what I want.

Can anyone confirm that this is what this criteria does (so that I can stop trying to make this work and find a different solution)?



[edited by: Summer Hirtzel at 6:00 PM (GMT -6) on 8 Nov 2016]
Parents
  • You found a bug!

    And your analysis is 100% correct -- if you were to run this query in February, you'd similarly only catch until March 28th.

    Do submit this to the network to be fixed, but in the meantime, you can correct the issue by manual-editing your query SQL.

    Based on what you've described, you should have a segment of your query that looks EXACTLY like this:

    DateAdd(mm,1,DateAdd(ss,-1,dateadd(mm,1,convert(datetime,DateName(mm,GetDate())+' 1 '+DateName(yy,GetDate())))))

    Change it to the following:

    DateAdd(ss,-1,DateAdd(mm,1,dateadd(mm,1,convert(datetime,DateName(mm,GetDate())+' 1 '+DateName(yy,GetDate())))))

    The problem bits are the ss,-1 and mm,1 bits at the beginning -- I would suggest editing them directly, rather than trying to paste in the entire line and losing a parentheses. Basically, Tessi is finding the last second in the current month, and THEN cycling forward to n months in the future, when it SHOULD be cycling forward to the first of n+1 months in the future FIRST, and THEN subtracting a second to roll back to the last second in the target month.
  • Thanks Nick! I checked the query, and you were right! It contained this:

    DateAdd(mm,1,DateAdd(ss,-1,dateadd(mm,1,convert(datetime,DateName(mm,GetDate())+' 1 '+DateName(yy,GetDate())))))

    which I made your suggested edits to. Generated the counts again, checked the segment contents, and got my desired result. Thank you! I'll report this bug to Tessitura.

  • I just ran into this issue and this post was super helpful in helping me resolve it. Thx! Did you ever submit this to Tessitura? It seems like it's still an issue in v12 (have not tested v14 yet)
  • Hi Andrew, Yes, we reported it to Tessitura as bug fix request # 78011 I don't think it would hurt if you submitted it as well, though! I'm eager for this bug to get fixed, and you know what they say about the squeaky wheel.
Reply Children