Hi,
It seems a stupid question but I tried multiple combination and failed.
In table A, I have thousands of records and I want to get all the different dates in this record.
In SQL, I know I can do it simply by
select date from TableA group by date
But now for X++ in AX
I tried
while select A group by A.Date
{
}
without success. In MS doc, the examples are for number or counting no dates. I don't quite understand how to achieve my requirement. Any help is grateful! Thanks!
*This post is locked for comments
Thanks, the problem is solved.
Yes, you are right. I made a mistake.
Do you have any records in that company ?
Hi Martin, my result is no result in return in my selection
It would help if you actually explained your problem. Saying "without success" doesn't tell us too much.
https://msdn.microsoft.com/en-us/library/aa656402.aspx
group by |
Instructs the database to group selected records by fields. |
CustTable custTable; ; while select sum(CreditMax) from custTable group by CustGroup { print custTable.CustGroup, " ",custTable.CreditMax; } |
You could do a count(RecId) to see how many records you have for the specific date instead of the sum() aggregate function in the example, and use the date for your grouping.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156