Click here to Skip to main content
15,890,438 members
Home / Discussions / Database
   

Database

 
GeneralRe: Arithmetic overflow error converting expression to data type int. Pin
Le centriste1-Mar-06 1:53
Le centriste1-Mar-06 1:53 
AnswerRe: Arithmetic overflow error converting expression to data type int. Pin
japel1-Mar-06 12:39
japel1-Mar-06 12:39 
Questionnewbie SQL question Pin
Mundo Cani28-Feb-06 10:57
Mundo Cani28-Feb-06 10:57 
AnswerRe: newbie SQL question Pin
Al Ortega28-Feb-06 11:14
Al Ortega28-Feb-06 11:14 
AnswerRe: newbie SQL question Pin
Colin Angus Mackay1-Mar-06 1:25
Colin Angus Mackay1-Mar-06 1:25 
GeneralRe: newbie SQL question Pin
Paul Conrad1-Mar-06 16:44
professionalPaul Conrad1-Mar-06 16:44 
QuestionExamples of creating multirecord databound controls for *WinForms* Pin
Rabb Moshe Plotkin28-Feb-06 5:33
Rabb Moshe Plotkin28-Feb-06 5:33 
QuestionFIFO financial analysis proc - any ideas? Pin
Duncan Edwards Jones28-Feb-06 2:27
professionalDuncan Edwards Jones28-Feb-06 2:27 
I have a table that has a set of financial transactions (simplified version)

Transactions
(
Account varchar(200),
TransactionDate datetime,
TransactionNo int,
TransactionType int,
Value money
)

Transactions can be payments or withdrawals. When a withdrawal takes place this is applied across the payments where the payment number is less than the withdrawal trans and the value of that transaction is reduced.

e.g. if I have transactions:
1, 2005-01-01 , Payment, $100
2, 2005-06-01 , Payment, $150
3, 2005-06-08 , Withdrawal, $180

Then after the third transaction the remaining value in the two payments is
1, 2005-01-01, Payment, $0
2, 2005-06-01, Payment, $70

So now I need to produce a report of the net value of the transactions account at a given date i.e. if the date passed in is less that 2005-06-08 then it would be $100 and $150 otherwise $0 and $70. Is there any clever view / query to do this or will i have to do a cursor?

Thanks in advance

'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
AnswerRe: FIFO financial analysis proc - any ideas? Pin
Chris Meech28-Feb-06 3:11
Chris Meech28-Feb-06 3:11 
QuestionErrors connecting to database Pin
Deffiant27-Feb-06 22:40
Deffiant27-Feb-06 22:40 
QuestionInserting Images Pin
monrobot1327-Feb-06 22:08
monrobot1327-Feb-06 22:08 
AnswerRe: Inserting Images Pin
minkinin27-Feb-06 23:49
minkinin27-Feb-06 23:49 
Questionhelp with connecting to database server Pin
cpence2527-Feb-06 19:39
cpence2527-Feb-06 19:39 
AnswerRe: help with connecting to database server Pin
Mike Dimmick28-Feb-06 6:28
Mike Dimmick28-Feb-06 6:28 
GeneralRe: help with connecting to database server Pin
cpence2528-Feb-06 13:03
cpence2528-Feb-06 13:03 
QuestionHow to insert records into two tables using single Query Pin
Rajkamal_dfine27-Feb-06 18:53
Rajkamal_dfine27-Feb-06 18:53 
AnswerRe: How to insert records into two tables using single Query Pin
Andy Brummer27-Feb-06 19:02
sitebuilderAndy Brummer27-Feb-06 19:02 
Questionrow.Insert(x) isn't updating my table. Pin
3197527-Feb-06 10:56
3197527-Feb-06 10:56 
AnswerRe: row.Insert(x) isn't updating my table. Pin
Ritesh123427-Feb-06 19:53
Ritesh123427-Feb-06 19:53 
AnswerRe: row.Insert(x) isn't updating my table. Pin
3197515-Mar-06 10:34
3197515-Mar-06 10:34 
QuestionExecute an SQL command with return value Pin
stephanm@cae.ca27-Feb-06 8:33
stephanm@cae.ca27-Feb-06 8:33 
QuestionSQL Server Comparing Dates Pin
Murthy India27-Feb-06 2:36
Murthy India27-Feb-06 2:36 
AnswerRe: SQL Server Comparing Dates Pin
J4amieC27-Feb-06 2:48
J4amieC27-Feb-06 2:48 
GeneralRe: SQL Server Comparing Dates Pin
Paul Conrad27-Feb-06 15:33
professionalPaul Conrad27-Feb-06 15:33 
GeneralRe: SQL Server Comparing Dates Pin
Murthy India27-Feb-06 18:19
Murthy India27-Feb-06 18:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.