Wednesday, March 28, 2012

Grouping prblm

Hi

This is my first post here so please be gentle.

I have a group sp which gets my data like below

spTest Surname DateSold PlotPrice Comp date SalesPerson Percentage RefundedAmount Site SaleID
Smith 06/04/2006 3,600.00 04/04/2006 Cooper 5 500.00 Site1 945
Smith 06/04/2006 11,600.00 06/04/2006 Cooper 5 500.00 Site2 945

The problem is i only want the RefundedAmount to be 500.00 once the rest to be 0 if the SaleID is the same

How can I get around this?

Any help would be great

CheersspTest Surname DateSold PlotPrice Comp date SalesPerson Percentage RefundedAmount Site SaleID
Smith 06/04/2006 3,600.00 04/04/2006 Cooper 5 500.00 Site1 945
Smith 06/04/2006 11,600.00 06/04/2006 Cooper 5 500.00 Site2 945

The problem is i only want the RefundedAmount to be 500.00 once the rest to be 0 if the SaleID is the same

Plz explain a bit more...whats that "once the rest to be 0" ?|||Hi sorry bad english.

The problem is i only want the RefundedAmount to be 500.00 once. The rest to be 0 if the SaleID is the same.

Hope that helps|||What you posted is the existing result set from your stored procedure ?

Can you post your table structure, sample data from the table and the expected result.

No comments:

Post a Comment