Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8307359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:30:36+00:00 2026-06-08T18:30:36+00:00

I am working on code from a person who held my position 2+ years

  • 0

I am working on code from a person who held my position 2+ years ago, and am having trouble deciphering a block of their SQL code.

WHERE  ACCOUNT NOT IN (SELECT ACCOUNT
                   FROM   MWAPPTS A1
                   WHERE  A1.ACCOUNT = A.ACCOUNT
                          AND ADATE > dbo.Endofmonth(ACTIONDATE)
                          AND REASON IN ('CPE','NPPE')
                          AND USERFLAG IN ( 'U', 'B' ))

dbo.Endofmonth is a stored procedure which gets the last day of the month for the inputed date.

If I am reading that right, we are not including rows where the account would be returned by the select statement shown. I am having problems with the select statement though. Am I correct that it is getting ACCOUNT where ADATE is older than the end of the month. The reason IS “CPE” or “NPPE”, and the USERFLAG is either “U”, or “B”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:30:36+00:00Added an answer on June 8, 2026 at 6:30 pm

    Yes, you are returning the records where the account does not have the following:

    1) an ADATE greater than the date returned by the function dbo.Endofmonth(ACTIONDATE).

    2) a Reason that is CPE or NPPE

    3) and the Userflag is either U or B.

    You would have to look at the code in the function dbo.Endofmonth(ACTIONDATE) to determine exactly what it is returning.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on some code that I inherited from a programmer who is
I am working on a piece of code that copies a 'Person' object from
I'm porting some (working) code from Linux to Windows 8. I'm using DDK. typedef
I'm working on a big c++ project and change code from other people. During
This is heavily trimmed down source code from a webpage I'm working on right
Recently, i am working with jquery for my mini-project. I took a code from
I'm working on some code that reads from a socket, and it goes wrong
i got this code working and it to return the last tweet from my
I'm trying to dynamically create a book from code server-side. That part's working fine,
Hi I wrote a code to read from the database and its working. but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.