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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:02:36+00:00 2026-05-31T20:02:36+00:00

My request is that a client wants to put in a date range (typically

  • 0

My request is that a client wants to put in a date range (typically a month) and pull all general ledger journals that have at least one line posted in that date range. They will post journals in March for January’s period for example, and want to know which journals have that data.

The basic idea is LedgerJournalTable to a firstonly LedgerJournalTrans. I’m not the best with the query object. Why isn’t my query working? It’s returning multiple journals instead of just one. I was thinking I could group by and be OK, but I’d think this would work.

static void Job38(Args _args)
{
    Query                   q;
    QueryRun                queryRun;
    QueryBuildDatasource    qbd;
    QueryBuildDatasource    qbd2;
    QueryBuildRange         qbr;
    LedgerJournalTable      ledgerJournalTable;
    ;

    info(strfmt("%1", date2strxpp(str2date('10/01/2011', 213))));

    q = new Query();
    qbd = q.addDataSource(tablenum(LedgerJournalTable));
    qbd2    = qbd.addDataSource(tableNum(LedgerJournalTrans));
    qbd2.relations(true);
    qbd2.firstOnly(true);
    qbd2.joinMode(JoinMode::InnerJoin);
    qbr = qbd2.addRange(fieldNum(LedgerJournalTrans, TransDate));
    qbr.value(strfmt('(TransDate > %1) && (TransDate < %2)', Date2StrXpp(str2date('10/01/2011', 213)), Date2StrXpp(str2date('10/31/2011', 213))));

    queryRun = new QueryRun(q);

    while (queryRun.next())
    {
        ledgerJournalTable = queryRun.get(tableNum(LedgerJournalTable));

        info(strfmt("%1", ledgerJournalTable.JournalNum));
    }
}
  • 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-31T20:02:37+00:00Added an answer on May 31, 2026 at 8:02 pm

    Have you tried JoinMode::ExistsJoin?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client request that all times be displayed in Pacific Time Zone,
I have a request in from a client that would like one of their
I have an application that needs to make a SOAP client request to a
I am developing a SSL client that will do a simple request to a
I'm developing a client/server app that will communicate via rest. Some custom request data
when using http post with flash that send ip address request from client computer
I have a PHP client that requests an XML file over HTTP (i.e. loads
I have a request that returns a JSON object with a single property which
I have a form for a nested resource (Client :has_many Workouts) that I want
Primary key attractiveness I have a boss(and also users) that wants primary key to

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.