Click here to Skip to main content
15,913,836 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL DATETIME ..... Help!!!!! Pin
andyharman14-Feb-07 2:05
professionalandyharman14-Feb-07 2:05 
GeneralRe: SQL DATETIME ..... Help!!!!! Pin
BooleanTrue14-Feb-07 2:54
professionalBooleanTrue14-Feb-07 2:54 
AnswerRe: SQL DATETIME ..... Help!!!!! Pin
Harini N K21-Feb-07 22:13
Harini N K21-Feb-07 22:13 
QuestionPlease review and suggest Pin
logicon14-Feb-07 0:52
logicon14-Feb-07 0:52 
AnswerRe: Please review and suggest Pin
Pete O'Hanlon14-Feb-07 1:35
mvePete O'Hanlon14-Feb-07 1:35 
GeneralRe: Please review and suggest Pin
logicon14-Feb-07 1:40
logicon14-Feb-07 1:40 
GeneralRe: Please review and suggest Pin
Pete O'Hanlon14-Feb-07 1:49
mvePete O'Hanlon14-Feb-07 1:49 
GeneralRe: Please review and suggest Pin
logicon14-Feb-07 2:24
logicon14-Feb-07 2:24 
Hi,

The scenario is like this, -

Company has several branches and Vendors are associated with branches separately. That means each vendor is attached to one branch only. Now company sales products through Vendors. Products which are being sold have different price on different week days. Vendors when take products from branch either pay cash or submit coupons. These coupons have some price and vendors can submit different types of coupons in different quantity. So suppose they take product of value 200, he can either pay full cash or submit coupons of worh 50 and cash 150. This paid amount can be less that total purchase sometime.

There are different queries like take one Branch Summary for any day -

In this we have to summaries sales and Payment for all branch like this -


------| Products |---------|--Received-|Total|--Day--|-Previous--|--Net--|
Branch| A | B | C| NetValue|Cash|Coupon|Value|Balance|Outstanding|Balance|

Here in Product Main Column we have to just sum the quantity of product sold that day,
Net value is sum of Price*Qnty for that branch,
Total Value is Cash + Coupon value (Coupon Value = Qnty * Price),
Day Balance = NetValue - Total Value
Previous Outstanding = Sum of all previous sale - Sum of all previous Cash Return - Sum of all previous Coupon Price * Qnty + sum of all opening balances of vendors of that branch
NetBalance = Day balance + Previous out standing

I have done this currently using many functions in VB but i want to do this using SQL only.

Thanks
GeneralRe: Please review and suggest Pin
andyharman14-Feb-07 2:39
professionalandyharman14-Feb-07 2:39 
GeneralRe: Please review and suggest Pin
logicon14-Feb-07 2:58
logicon14-Feb-07 2:58 
Questioncase sensitive search Pin
Rocky#14-Feb-07 0:02
Rocky#14-Feb-07 0:02 
AnswerRe: case sensitive search Pin
andyharman14-Feb-07 0:09
professionalandyharman14-Feb-07 0:09 
GeneralRe: case sensitive search Pin
Rocky#14-Feb-07 17:40
Rocky#14-Feb-07 17:40 
AnswerRe: case sensitive search Pin
Pete O'Hanlon14-Feb-07 1:25
mvePete O'Hanlon14-Feb-07 1:25 
QuestionDatabase SqlServer2000 on Server Pin
sanaziuse13-Feb-07 22:34
sanaziuse13-Feb-07 22:34 
AnswerRe: Database SqlServer2000 on Server Pin
Pete O'Hanlon13-Feb-07 23:24
mvePete O'Hanlon13-Feb-07 23:24 
GeneralRe: Database SqlServer2000 on Server Pin
sanaziuse13-Feb-07 23:44
sanaziuse13-Feb-07 23:44 
GeneralRe: Database SqlServer2000 on Server Pin
Pete O'Hanlon13-Feb-07 23:46
mvePete O'Hanlon13-Feb-07 23:46 
QuestionQuery regarding view Pin
Member 309559313-Feb-07 21:40
Member 309559313-Feb-07 21:40 
AnswerRe: Query regarding view Pin
andyharman13-Feb-07 22:58
professionalandyharman13-Feb-07 22:58 
QuestionSQL Server 2005 Mixed Mode login Change Pin
JacquesDP13-Feb-07 20:47
JacquesDP13-Feb-07 20:47 
QuestionHelp on a query Pin
logicon13-Feb-07 20:21
logicon13-Feb-07 20:21 
AnswerRe: Help on a query Pin
andyharman13-Feb-07 22:50
professionalandyharman13-Feb-07 22:50 
GeneralRe: Help on a query Pin
logicon13-Feb-07 23:03
logicon13-Feb-07 23:03 
GeneralRe: Help on a query Pin
Pete O'Hanlon13-Feb-07 23:25
mvePete O'Hanlon13-Feb-07 23:25 

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.