Click here to Skip to main content
15,906,625 members
Home / Discussions / Database
   

Database

 
GeneralRe: Reportviewer control Pin
Rupesh Kumar Swami26-Jul-07 19:53
Rupesh Kumar Swami26-Jul-07 19:53 
Questionmultible images from databse Pin
cool34922-Jul-07 12:17
cool34922-Jul-07 12:17 
AnswerRe: multible images from databse Pin
Pete O'Hanlon23-Jul-07 1:51
mvePete O'Hanlon23-Jul-07 1:51 
Questioniterating values in sql Pin
n_gchaitra22-Jul-07 0:07
n_gchaitra22-Jul-07 0:07 
AnswerRe: iterating values in sql Pin
Joe22-Jul-07 21:21
Joe22-Jul-07 21:21 
GeneralRe: iterating values in sql Pin
n_gchaitra23-Jul-07 1:53
n_gchaitra23-Jul-07 1:53 
AnswerRe: iterating values in sql Pin
jonathan1523-Jul-07 5:34
jonathan1523-Jul-07 5:34 
GeneralRe: iterating values in sql Pin
n_gchaitra23-Jul-07 17:31
n_gchaitra23-Jul-07 17:31 
I dont know whether i have to use cursor or simply a stored prcedure.
This is FIFO inventory system. Recieved and Issue items will be in different table say, RECIEVE & ISSUE. Each item may be recieved and issued many times. Each time may be with different rate,quantiy and date. For example let us considere the following tables,

RECIEVE TABLE

PARTNO RDATE RRATE/UNIT rQUANTITY

A 10/10/2006 15 20

A 10/10/2007 20 50

A 1/11/2006 18 10

B 10/12/2006 15 30

B 13/2/2007 25 15



ISSUE TABLE

PARTNO IDATE IRATE/UNIT iQUANTITY

A 10/5/2007 18 18

A 1/12/2007 20 45

A 13/2/2007 20 15

B 13/2/2007 20 20

B 1/5/2007 20 25

Ultimately i have to get the following table

PARTNO IDATE IRATE/UNIT iQUANTITY ShortTerm LongTerm

Here I want to find the LongTerm Value and Shorttem value depending on the difference in date between idate and rdate of each item. This is to find the gain or loss of the item in that particular date. The formula is iquatity(irate)+iquatity(irate-rRate),if the date difference between recieve and issue is >365 day then the calculated value should be place in LongTerm value column else in the Short term value column

First we take A, the first issue quanitity is 18, but the no of quantity recieved was 20 so the value will be 18(18)+18(18-15). Now the remaining no of items present in first recieved is 2.The difference between issue date 10/5 /2007 and recieve date 10/10/2006 is less than 365 days so has to be placed in ShortTerm column.

So when calculating the amount of second issue first we have issue remaining 2, then go for second recieve. Here issue quantity is 45. so, the value must be (2(20)+2(20-15)). The difference between issue date 1/12/2007 and recieve date 10/10/2006 is more than 365 days so has to be placed in LongTerm column. Then remaining 43 items, the value has to be (43(20)+(43(20-20). The difference between issue date 1/12/2007 and recieve date 1/12/2007 is less than 365 days so has to be placed in ShortTerm column. Now the remaining items in Recieve table for A item is 7+10.

Now we have to calculate the next A item as we did for second. i.e. first issuing 7 items from the remaining RECIEVE and then another 8. So we are left with 2 recieved items which will be there until next issue.

This has to be repeated for the Item B and so on.




Chaitra N

QuestionUpdate clause using if condition Pin
n_gchaitra21-Jul-07 22:05
n_gchaitra21-Jul-07 22:05 
AnswerRe: Update clause using if condition Pin
Colin Angus Mackay21-Jul-07 22:48
Colin Angus Mackay21-Jul-07 22:48 
Questiondatedifference from two different tables Pin
n_gchaitra21-Jul-07 21:01
n_gchaitra21-Jul-07 21:01 
AnswerRe: datedifference from two different tables Pin
N a v a n e e t h22-Jul-07 22:51
N a v a n e e t h22-Jul-07 22:51 
GeneralRe: datedifference from two different tables Pin
n_gchaitra23-Jul-07 1:51
n_gchaitra23-Jul-07 1:51 
QuestionAccess to one table in quick succession cause problem. Pin
cosma21721-Jul-07 11:04
cosma21721-Jul-07 11:04 
QuestionReport genaration: Data exchange to MS-Excel Pin
Ravisubrahmanya21-Jul-07 3:11
Ravisubrahmanya21-Jul-07 3:11 
AnswerRe: Report genaration: Data exchange to MS-Excel Pin
Rob Graham21-Jul-07 4:07
Rob Graham21-Jul-07 4:07 
AnswerRe: Report genaration: Data exchange to MS-Excel Pin
Ravisubrahmanya21-Jul-07 6:54
Ravisubrahmanya21-Jul-07 6:54 
QuestionRe: Report genaration: Data exchange to MS-Excel Pin
Ravisubrahmanya21-Jul-07 7:26
Ravisubrahmanya21-Jul-07 7:26 
QuestionHow to restore MSDE server data into SQL server database? Pin
Ravisubrahmanya21-Jul-07 2:45
Ravisubrahmanya21-Jul-07 2:45 
AnswerRe: How to restore MSDE server data into SQL server database? Pin
Rob Graham21-Jul-07 3:57
Rob Graham21-Jul-07 3:57 
Questionunexpected behaviour of Reportviewer control Pin
Rupesh Kumar Swami20-Jul-07 23:00
Rupesh Kumar Swami20-Jul-07 23:00 
QuestionSelecting records of last two days: Pin
Shahzad.Aslam20-Jul-07 21:43
Shahzad.Aslam20-Jul-07 21:43 
AnswerRe: Selecting records of last two days: Pin
Christian Graus20-Jul-07 21:47
protectorChristian Graus20-Jul-07 21:47 
AnswerRe: Selecting records of last two days: Pin
bablu_singh22-Jul-07 19:49
bablu_singh22-Jul-07 19:49 
Questionhelp for sql query plz Pin
amjad ali shah20-Jul-07 2:09
amjad ali shah20-Jul-07 2:09 

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.