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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:06:56+00:00 2026-05-30T03:06:56+00:00

Forgive me if the title (and my SQL knowledge) seems a bit vague but

  • 0

Forgive me if the title (and my SQL knowledge) seems a bit vague but I will try and explain as clearly as I can.

I have a table DVE_GroupMember, in which Person_StaffNumber is a unique identifier for a person. In this table is a column GroupMember_GroupName which contains a group name that a person can be assigned to.

There is also column GroupMember_StartDate which signified when that person was assigned to that GroupMember_GroupName.

A person can have been assigned to various groups over a period of time, so if I run the following SQL, I get multiple results for the various Person_StaffNumber values in the database (where the group name contains ‘muster’)

select * 
from DVE_GroupMember 
where GroupMember_GroupName like 'muster%'

What I am trying to do, is select the most recent GroupMember_GroupName that each person has been assigned to.

I have tried the following syntax but it is generating the error ‘incorrect syntax near ‘)’

select * 
from DVE_GroupMember 
where GroupMember_GroupName like 'muster%' 
    and GroupMember_StartDate = (SELECT MAX(GroupMember_StartDate)

Would anyone be able to help me with this?

Thanks

  • 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-30T03:06:57+00:00Added an answer on May 30, 2026 at 3:06 am
    SELECT
        * 
    FROM
        DVE_GroupMember GM
    WHERE
        GroupMember_GroupName LIKE 'muster%'
        AND GroupMember_StartDate = (
            SELECT
                MAX(GroupMember_StartDate)
            FROM
                DVE_GroupMember _GM
            WHERE
                _GM.GroupMember_GroupName LIKE 'muster%'
                AND _GM.Person_StaffNumber = GM.Person_StaffNumber)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Forgive the vague title, I wasn't sure how to describe it. If you have
I apologize for the terrible title...it can be hard to try to summarize an
Forgive the title, I'm not really sure how to explain what I'm seeing. Sample
That title probably doesn't sound right, but forgive me, I'm learning Rails for the
Forgive me about the title, I have no idea what this is called. I
Forgive the title, wasn't sure what to put. I have some code like: var
Forgive me if the title is not lucid, but I could not better describe
If my title seems stupid, forgive me. I'm a newbie in jQuery and I
Forgive the title of the question; spent 20 minutes trying to write something coherent
Basically what the title says. (Forgive me because I am a .NET newb) In

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.