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 8811419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:21:32+00:00 2026-06-14T03:21:32+00:00

I have an SQL table with Member ID’s. Each member has information regarding their

  • 0

I have an SQL table with Member ID’s.

Each member has information regarding their insurance claims listed in the table.

One column lists insurance ID’s in relation to Member-ID.

for example:-

|Member ID    | Insurance Code   |
----------------------------------
|C#$#@@!1231  | 67               |

Now the issue is the same member could have different Insurance Code#’s as a part of previous claims.

For example between 2010 -2011, the member had a claim Code = 67
But for 2011 – 2012, the member had a claim Code = 3

Now when I create a SQL query, I only get one value for claim code…. how can I get all the values, say 67, 3, and 110? Such that I can respond to all claims that the member has been a part of.

// SQL QUERY to gather member information.
DMS.ADOQuery1.SQL.Clear;
DMS.ADOQuery1.SQL.Add('select HPFROMDT, HPthruDt, MEMBERKEY, MEMBHPKEY, OPFROMDT, OPTHRUDT, HPCODEKEY' +
                      ' from MEMBHP' +
                      ' where MEMBERKEY = ''' + MembKey + '''  and OPTHRUDT >= ''' + init_date + ''' and OPFROMDT <= ''' + final_date +''' and OPFROMDT < OPTHRUDT'
                     );

//  Showmessage(DMS.ADOQuery1.SQL[0]);

DMS.ADOQuery1.Open;

// Adding the query values to the appropriate variables.
HPCodeKey := (DMS.ADOQuery1.FieldByNAme('HPCODEKEY').AsString);

DMS.ADOQuery1.Close;
  • 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-14T03:21:33+00:00Added an answer on June 14, 2026 at 3:21 am

    Check all the records returned by query, not only the first one.
    Check also filter dates in SQL statement (where condition).

    // SQL QUERY to gather member information.
    DMS.ADOQuery1.SQL.Clear;
    DMS.ADOQuery1.SQL.Add('select HPFROMDT, HPthruDt, MEMBERKEY, MEMBHPKEY, OPFROMDT,      OPTHRUDT, HPCODEKEY' +
                      ' from MEMBHP' +
                      ' where MEMBERKEY = ''' + MembKey + '''  and OPTHRUDT >= ''' +   init_date + ''' and OPFROMDT <= ''' + final_date +''' and OPFROMDT < OPTHRUDT'
                     );
    
    //  Showmessage(DMS.ADOQuery1.SQL[0]);
    
    DMS.ADOQuery1.Open;
    
    while not DMS.ADOQuery1.Eof do
    begin
      // Adding the query values to the appropriate variables.
      Showmessage(DMS.ADOQuery1.FieldByNAme('HPCODEKEY').AsString);
      DMS.ADOQuery1.Next;
    end;
    DMS.ADOQuery1.Close;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three table in SQL database such as table Person has relation one
I have a SQL table BookChapters with over 20 millions rows. It has a
I have a SQL table that has a primary key ( Row_id ) that
I have a SQL table where in each row I store the country and
I have a table which contains due dates for individual member records. Each row
I have two MySQL tables A and B . Table A has a member
Just need some help with a SQL statement, I have a table that has
I am needing some help with SQL syntax. Say I have a members table,
I have a SQL table with periodic measurements. I'd like to be able to
I have an sql table containing the gps coordinates of a device, updated every

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.