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

  • SEARCH
  • Home
  • 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 4618102
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:13:07+00:00 2026-05-22T02:13:07+00:00

I am trying to display records which are created after Oct 1 2010. But

  • 0

I am trying to display records which are created after Oct 1 2010. But my query doesn’t seem to work. It also display records from 2004 – Sept 2010 which is not wanted.

What is wrong with the query below?

select Distinct app.app_id,
  (convert(varchar, creation_date,101) + ' ' +  convert(varchar,creation_date ,108)) as creation_date,
  dbo.oea_fn_get_amc_mem_name(app.app_id,primary_msn,getdate(), 'EN', 30000) PIName,
  dbo.oea_fn_get_pid_countyname(app.app_id,primary_msn,'OC')as PIpid,
  primary_msn,
  zip,
  home_tel,
  work_tel,
  work_extn,
  other_contact,
  other_ext,
  cell_tel,

  dbo.oea_fn_get_amc_mem_name(app.app_id,mem.msn,getdate(), 'EN', 30000)as Kname,
  dbo.oea_fn_get_pid_countyname(app.app_id,mem.msn,'OC')as Knamepid,
  mem.msn as Kmsn,
  (select count(reminder_id) from reminders (nolock) where app_id=app.app_id) as reminder

from app_application app  (nolock)
inner join app_member mem  with (nolock) on  app.app_id=mem.app_id 
--left outer join Oea_App_Program_Disposition disp with (nolock) on mem.app_id = disp.app_id and mem.msn=disp.msn
inner join app_address aadd with (nolock) on app.app_id=aadd.app_id
--inner join app_calc_results calc  with (nolock) on mem.app_id=calc.app_id and calc.msn=mem.msn
left outer join app_member_benefits ben with (nolock) on mem.app_id = ben.app_id and mem.msn=ben.msn

where  
 isnull(mem.coverage_required,0) = 1
 and app.app_status = 's'
     and ben.ins_end_date < getdate()
     and app.client_id = 30000
     and app.app_id  not in (select app_id from app_renewal) 
     and (mem.msn in (select calc.msn from app_calc_results calc 
                 inner join app_application app on calc.app_id = app.app_id and calc.prog_id = 'CK' and calc.opt_out = 1))
     and (mem.msn in (select msn from app_calc_results where app_id=app.app_id and status not in ('A','X')))
     or (mem.msn in (select msn from Oea_App_Program_Disposition where app_id=app.app_id and disp_status not in ('A','P')) )
     and app.creation_date >= '10/01/2010'

Thanks for all the help.

  • 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-05-22T02:13:08+00:00Added an answer on May 22, 2026 at 2:13 am

    You probably want this:

     and (
         (mem.msn in (select calc.msn from app_calc_results calc 
                     inner join app_application app on calc.app_id = app.app_id and calc.prog_id = 'CK' and calc.opt_out = 1))
        or (mem.msn in (select msn from app_calc_results where app_id=app.app_id and status not in ('A','X')))
        or (mem.msn in (select msn from Oea_App_Program_Disposition where app_id=app.app_id and disp_status not in ('A','P')) )
         )
     and app.creation_date >= '10/01/2010'
    

    The problem is with the logic behind the or in the where clause.

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

Sidebar

Related Questions

I am trying to display all of the records from a database in phpMyAdmin.
I am trying to put together a query that will display one specific record
trying to display data only after variables have been set. $(document).ready(function () { function
I am trying to display data that I am getting from server through json.
I am trying to display a GIF image in my GUI, and it doesn't
I'm trying to display all such rows of a table STUDENTS which have a
I was trying to think of a logic to implement this mysql query but
I am trying to develop app, which records audio & playback.I am able to
I'm trying to build a visual web part for SharePoint 2010 which should connect
I am trying to display data from my database to a Jsp page using

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.