AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • In-Person Gatherings
    • Power BI Workshop
    • Podcast
    • Rolodex
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
Generic Inquiry - U...
 
Notifications
Clear all

Questions Generic Inquiry - Use subqueries for a field

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Laura Carpenter 4 years ago
6 Posts
4 Users
1 Reactions
6,687 Views
RSS
Tim Henning
Posts: 7
 Tim Henning
Topic starter
October 25, 2018 3:57 pm
(@tim-henning)
Member
Joined: 7 years ago

Do Generic Inquiries have the ability to perform a subquery for a linked table field similar to a SQL statement?  See SQL example for BREarliestEndDate below:

Select

    IR.Title,

    =SUM([BillingRule.TotalFunded]) as TotalFunded,

    (select MIN(br.EndDate) from BillingRule br where br.Status = ‘Open’ and br.InvoiceRuleID = IR.InvoiceRuleID) as BREarliestEndDate,

From

    InvoiceRule IR              

Would I add the table without the relation and then write an expression in the result grid?

Thanks ahead of time.

 

Tim


5 Replies
Royce Lithgo
Posts: 557
 Royce Lithgo
October 25, 2018 8:49 pm
(@roycelithgo)
Honorable Member
Joined: 6 years ago

No, GIs cannot do SQL subqueries. There are many things they can't do. For example, grouping on expressions, filtering on aggregated data.

I really hope Acumatica greatly improves GI functionality. Coming from a SQL background as I do, I find them extremely limiting. 


Reply
Tim Henning
Posts: 7
 Tim Henning
Topic starter
October 27, 2018 10:24 am
(@tim-henning)
Member
Joined: 7 years ago

I found I could achieve a workaround by using an expression in the results grid for the Earliest End Date.

=Min(IIf([BillingRule.Status] = 'O', [BillingRule.EndDate], '01/01/2199'))

Since, I am only interested in EndDates dates where the Status is a value of 'Open', the expression above works.  I just filter out the value = '01/01/2199' in the report.

I hope this helps someone else.


Reply
Tim Henning
Posts: 7
 Tim Henning
Topic starter
October 29, 2018 9:40 am
(@tim-henning)
Member
Joined: 7 years ago

https://www.acumatica.com/blog/technical-tuesday-report-from-sql-view/

 


Reply
Tim Rodman
Posts: 3199
 Tim Rodman
Admin
November 1, 2018 2:06 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Yep, building a SQL View and feeding it to a Generic Inquiry is my workaround for this situation.


Reply
Laura Carpenter
Posts: 10
 Laura Carpenter
July 19, 2022 1:27 pm
(@lauracarpenter)
Active Member
Joined: 5 years ago

This is a great work around.  I was able to use the forumla to find the first and last dates for of all of production orders for each of our project to use in a dashboard widget. 


Reply
Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,528 Topics
  • 10.9 K Posts
  • 10 Online
  • 2,414 Members
Our newest member: Megan Pawlowski
Latest Post: Credit Reference Report Needed
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2026 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×