I was developing a 'Payment Tracker' web application. I used MS Access as back-end database. I made a 'Payment_entry' table with user_ID and Payment_amount fields with 'Text' and 'Long integer' datatypes. Now , when I wanted to find the total payment of each user I used the following SQL command :
Select user_ID , SUM(payment_amount) From Payment_entry Group By payment_amount ;
But unfortunately I got strange result from the command. Then I got back to my database and reset the datatype of Payment_amount field from Long integer to Decimal. Then I again applied the SQL command. This time I got the correct result. From this , I think that the Sum( ) function does not work correctly with the long integer datatype. Am I correct in this decision ? I want logical comments.