Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

[Microsoft][SQL Server Native Client 10.0][SQL Server]The multi-part identifier "T2.QTY" could not be bound

(0) ShareShare
ReportReport
Posted on by 570

Hello all,

I've a runbasebatch class which use a simple query object  like this:

SELECT COUNT(T1.RECID),SUM(T2.QTY),SUM(T2.COSTAMOUNTPOSTED),SUM(T2.COSTAMOUNTADJUSTMENT),COUNT(T2.RECID) FROM (SELECT TOP (2147483647) 1 AS RecId FROM INVENTTABLE T1 CROSS JOIN INVENTTRANS T2 CROSS JOIN INVENTTRANSORIGIN T3 WHERE ((T1.PARTITION=?) AND (T1.DATAAREAID=?)) AND (((T2.PARTITION=?) AND (T2.DATAAREAID=?)) AND (((T2.STATUSISSUE=?) OR (T2.STATUSISSUE=?)) AND (T2.ITEMID=T1.ITEMID))) AND (((T3.PARTITION=?) AND (T3.DATAAREAID=?)) AND ((T3.REFERENCECATEGORY=?) AND (T2.INVENTTRANSORIGIN=T3.RECID))) GROUP BY T1.ITEMID ORDER BY T1.ITEMID ) AS T1

The query is an inner join, group by itemId on Inventtable, inventtrans and inventransorigin, fetch mode 1:1

I get the SQL error trying to add new value range to the query in the run() method:

 qbr = SysQuery::findOrCreateRange(qr.query().dataSourceTable(tableNum(inventTrans)), fieldNum(inventTrans, DateFinancial));
 qbr.value(SysQuery::range(fromDate, toDate));  <--- 

If I don't add the qbr.value  instruction all works fine, but unfortunately I have to override the  Datefinancial with a new range

Any idea?

KR

PS: This is the query definition:



*This post is locked for comments

  • PIX Profile Picture
    570 on at
    RE: [Microsoft][SQL Server Native Client 10.0][SQL Server]The multi-part identifier "T2.QTY" could not be bound

    Hello,

    really strange but the reason is due to the following instr:

    progressTotal = QueryRun::getQueryRowCount(qr.query(), intMax());

    replacing that with SysQuery::countloops()

    all works fine!!!

    I don't know why but works....

  • dolee Profile Picture
    11,279 on at
    RE: [Microsoft][SQL Server Native Client 10.0][SQL Server]The multi-part identifier "T2.QTY" could not be bound

    Please send the xpo to dlee@pbc.co.jp.

  • PIX Profile Picture
    570 on at
    RE: [Microsoft][SQL Server Native Client 10.0][SQL Server]The multi-part identifier "T2.QTY" could not be bound

    I just have an .xpo

    It is a query obj built by AOT

  • Martin Dráb Profile Picture
    231,723 Most Valuable Professional on at
    RE: [Microsoft][SQL Server Native Client 10.0][SQL Server]The multi-part identifier "T2.QTY" could not be bound

    Don't you have X++ definition of the query (QueryBuildDataSource etc.)? Now if somebody wants to try it, he musts rework the whole query from SQL to X++ (and probably won't bother).

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans