Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012
    Posts
    2

    Red face Unanswered: SQL Server Query

    I have a table which has account numbers based on the billing periods.
    There could be a chance that some accounts DO NOT fall in the last billing period '201203'. I want to extract all those accounts which Do not exist in 201203. I know for sure that commands like 'Not In', '!=' wont work in this case as they just won't display the data in the results whereas i need to find accts which are not there in the database for 201203.


    Table Name: bias_cabs

    Billing Period Acct Nbr
    201003 80025494222
    201004 80025494222
    201005 80025494222
    201006 80025494222
    201007 80025494222
    201008 80025494222
    201203 80025494222

    Can someone help me on this as to which command will give me perfect results.

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Select distinct [Acct Nbr] from bias_cabs where [Acct Nbr] not in(Select [Acct Nbr] from bias_cabs WHERE period ='201203')
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    May 2012
    Posts
    2

    Thumbs up

    Thanks Enigma...It worked perfectly

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •