Can someone tell me why this select statement does not pull the correct data?

  • Data consists of

    fcinvoice, finvdate, fcstatus

    0000071053, 2016-05-02 00:00:00.000, F

    0000071894, 2016-09-13 00:00:00.000, F

    0000081833, 2022-03-04 00:00:00.000, F

    0000082570, 2022-08-22 00:00:00.000, F

    When I run this select statement it does not pull any data but ith I remove either of the last finvdate between lines it pulls the correct data. What I would expect this to pull is the last 2 lines.

    select fcustno, fnamount, finvdate 
    from armast where (finvdate Not Between '01/01/2017' and '01/01/2022') and
    (finvdate between '01/01/2022' and '09/01/2022') and
    (finvdate between '01/01/2006' and '01/01/2017') and
    (fcstatus <> 'V' and fcstatus = 'F') and
    fcustno = '004861'

     

     

  • Please post a question only once. Answers here please.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply