Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 deposit/withdraw

Author  Topic 

programer
Posting Yak Master

221 Posts

Posted - 2011-04-21 : 12:21:27
I have a big problem.

I have a table tbl_usertransactions and tbl_registeredusers


When the user paid into your account, it appears that amount in the account.

Example:
Visa pay ... 10 usd
Visa pay ... 20 usd
Visa pay ... 50 usd

and if the user withdraw money -20usd ...

Total payments (Visa 3x) = 80usd - $ 20.

It still remains on the account 60usd...

Do I need to create a new field Amount in the table tbl_registeredusers or ...?

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-04-21 : 12:27:17
Isn't that what you would expect? That the remaining amount would be sixty?

If you can post the DDL for your tables along with some sample data that will demonstrate the problem, some of the people on this forum may be able to offer useful suggestions and help. Take a look at this page to see how to post the DDL: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2011-04-21 : 12:34:50
quote:
Originally posted by sunitabeck

Isn't that what you would expect? That the remaining amount would be sixty?

If you can post the DDL for your tables along with some sample data that will demonstrate the problem, some of the people on this forum may be able to offer useful suggestions and help. Take a look at this page to see how to post the DDL: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx





Yes this is what I expect 60 USD.
But I do not know whether to add an additional field "Amount" in the table tbl_registeredusers?
Your suggestions?
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-04-22 : 08:47:43
Without seeing the tables and knowing a little bit more about the business logic you are trying to implement, that is hard to say. But as a general rule, I would expect that your tbl_registedUsers would have information about the user - such as firstname, lastname etc. along with a unique userId. Then, the balance information and transaction information would be in other tables which would have the userID as one of the columns.

Can you post the DDL for the tables and some sample data? Brett's post here may be of help in getting the DDL and on general guidelines for posting which would make it for someone to understand and respond with useful suggestions. http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-04-22 : 09:31:14
Dupe, please continue the discussion here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=159774
Go to Top of Page
   

- Advertisement -