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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

form query and T_SQL query return different values for totalcostamountfield

(0) ShareShare
ReportReport
Posted on by 1,271

Hello,

I have a standard form called Posted Project Transactions(projProjectTransactionsListPage). I open it for a particular project and get 40 records. The values for TotalCostAmountCur values are like below following

Total cost amount
264.00
264.00
264.00
264.00
264.00
264.00
32.50
303.64
800.00
301.52
223.63
94.23
296.00
130.00
216.88
800.00
86.69
118.37
242.00
130.00
325.32
800.00
86.69
118.37
300.00
130.03
118.37
376.90
136.33
136.33
136.33
136.33
136.33
800.00
28.27
28.27
28.27
184.86
28.27
28.27

and their sum is 9423

The underlying query of the form before the form opens is 

SELECT FIRSTFAST FORUPDATE * FROM ProjPostTransView(ProjPostTransView_1) 
	ORDER BY ProjPostTransView.TransDate ASC 
		WHERE ((TransDate>={ts '2003-11-12 00:00:00.000'})) AND ((ProjId = N'0151328')) 
	JOIN FORUPDATE * FROM ProjTable(ProjTable_1) 
		ON ProjPostTransView.ProjId = ProjTable.ProjId 
	NOTEXISTS JOIN FORUPDATE * FROM ProjPostTransSaleView(ProjPostTransSaleView_Invoiced) 
		WHERE ProjPostTransView.TransId = ProjPostTransSaleView.TransId AND ((TransStatus = 1)) 
	NOTEXISTS JOIN FORUPDATE 'x' FROM ProjOnAccTransView(ProjOnAccTransView) 
		WHERE ProjPostTransView.TransId = ProjOnAccTransView.TransId AND ((TransactionOrigin = 22)) AND ((PSAIsOnAccount = 1)) 
	OUTER JOIN FORUPDATE * FROM ResourceView(ResourceView) 
		ON ProjPostTransView.Resource = ResourceView.RecId 
	OUTER JOIN FORUPDATE * FROM smmActivities(smmActivities) 
		ON ProjPostTransView.ActivityNumber = smmActivities.ActivityNumber AND ProjPostTransView.dataAreaId = smmActivities.dataAreaId 
	EXISTS JOIN FORUPDATE * FROM ProjTable(ProjTable_2) 
		WHERE ProjPostTransView.ProjId = ProjTable.ProjId}

Then I run the following query in T-SQL

select totalcostamountcur from PROJPOSTTRANSVIEW
 where projid = '0151328'

it returns the following values for totalcostamount field and numver of records is also 40.

TotalCostAmount

264.00
264.00
264.00
264.00
264.00
264.00
800.00
301.52
178.00
75.00
303.64
32.50
130.00
296.00
86.69
118.37
800.00
216.88
242.00
325.32
800.00
118.37
86.69
130.00
300.00
130.03
300.00
118.37
136.33
136.33
136.33
136.33
136.33
800.00
28.27
28.27
28.27
147.14
28.27
28.27

the values surprisingly are different and their sum is also different. It's 9243.52.

It seems like on the form some dynamics values are added to the field. I have studied all the code relating to the form but I don't see any indirect adding any values to the field totalcostamount. Therefore I'm at a dead end. Any suggestions where to look at are much appreciated.

Many thanks.

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    305,455 Super User 2026 Season 1 on at

    Hi Azat,

    What exact column did you take from the form Posted project transactions?

    The column Amount in transaction currency is the actual field TotalCostAmountCur.

    The column Total cost amount is a calculated field which would take the actual item cost (including recalculations) and for hour transactions it could add indirect cost.

    This could explain the difference(s).

  • dark_knight Profile Picture
    1,271 on at

    Hi Andre. Thank you. you are right. I found this in the postload of the corresponding data entity - ProjPostTransViewEntity

    pastedimage1670997666822v2.png

    Thank you.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 612

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 589 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans