Rafael, What data type is the field you are summing? Dave
-----Original Message----- From: ProFox [mailto:[email protected]] On Behalf Of Rafael Copquin Sent: 12 November 2015 19:18 To: [email protected] Subject: problem with calculations with VFP9 and MSSQL Server I am selecting a bunch of invoices from a MS SQL Server table. I just want to add the total of all invoices. In the management studio I do this: Select sum(total) as total from terbo.dbo.invoices I get 212649.17 When I do the same calculation in VFP cCmd = ‘Select sum(total) as total from terbo.dbo.invoices’ sqlexec(thisform.nHandle,cCmd,’curTotals’) nTotal = curTotals.total nTotal is 212.65 In my VFP regional settings I have set decimals = 2 and set point = [.] How can I get the correct amount? Rafael Copquin Enviado desde Correo para Windows 10 --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious. _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

