Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    110

    Unanswered: Using SQL Not In

    I am trying to find months that do not exist. Currently I am putting in the event, month, and year when I run the query. I would like to be able to run the report based on event and year, and it would return the months and counties not reported. I have a table of counties, and months. The year is generated when the record is entered on the form. If I run this as shown below it works, but it would mean running it for each month seperately.

    Any assistance would be helpful. Thanks!


    SELECT COUNTY.COUNTY_NAME, [ENTER REPORT MONTH] AS [MONTH], [ENTER REPORT YEAR] AS [YEAR]
    FROM COUNTY
    WHERE (((COUNTY.COUNTY_NAME) Not In (SELECT COUNTY FROM MARRDIVMAIN WHERE EVENT_TYPE = [ENTER EVENT TYPE] AND REPORT_MONTH = [ENTER REPORT MONTH] AND REPORT_YEAR = [ENTER REPORT YEAR])));

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    What's a month that does not exist?
    Have a nice day!

Posting Permissions

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