So you want the total for all purchOrders and not just the current purchase order?
If that's the case, your code won't work because in the where condition you are saying where pts.PurchId = this.PurchId -- which means it will give the total for only this PurchId
If you need the total for all PurchIds then you need to use the keyword "count"
Select count(FieldYouWantToCount) from Table1
Thanks,
Layan Jweihan
Was this reply helpful?YesNo
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.