web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

A Problem with creating the query x++

(0) ShareShare
ReportReport
Posted on by 2,050

Greeting everyone 

by using while select i'm really confused to how create a query by x++ for my request?

i have this table 

plans.JPG

i have tow request from this table i don't know get it by x++ select 

1-i need employees which have only (Plan==PlanA &&  Status==Open) must this employees doesn't have another different row

and the result should be 
(Katey , Ben) 

others will be ignored because they have more than this satiation Plan and Status

2-i need employees which have only (Plan==PlanB &&  Status== Close )must this employees doesn't have another different row

and the result should be 
(Sara) 

others will be ignored because they have more than this satiation Plan and Status

i really try many select but all gone wrong how can i do that also i did used group by but still not give me the result which i need?

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,286 on at

    Record record;

    Record notExistsRecord;

    -- first case

    select record 

    where record.Plan=='PlanA'

    &&  record.Status=='Open'

    notexists join notExistsRecord

    where record.Plan == notExistsRecord.Plan

    && record.RecId != notExistsRecord.RecId;

    --second

    select record 

    where record.Plan=='PlanB'

    &&  record.Status=='Closed'

    notexists join notExistsRecord

    where record.Plan == notExistsRecord.Plan

    && record.RecId != notExistsRecord.RecId;

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 679 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 332 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Martin Dráb 238 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans