how to select query to find bonus ,qtd sold for that period ?
am facing a problem with a queryto find the item info , for all the item sold , bonus qty
I have a table trans with the following
qty_sold number (25,10)
where item_code is the name of item
slt_code is the type of sales , it can be C or B (c being cash and b being bonus )
invoice_date is the date
sa_amount is the cost of the the items sold
qty_sold is the quantity sold of the item(depending on whether its C, or B)
fy_year indicates the year
fyp_seq indicates the period
example of table data
PHBI0 C 24-MAR-08 20 12 2008 3
PHBI0 B 28-MAR-08 0 10 2008 3
PHBI0 C 24-FEB-08 10 10 2008 2
problem is to display the
item_code , cost of the item(this should contain only belonging to slt_code C), qty_sold (again belonging to slt_code c), bonus quantity(belonging to slt_code =B) , ytd_qty( this should total all the qty of the particular item upto the current period for the slt_code =C)
so if i run a query for the item_code PHBIO for the period of march
i should get the result as
I have all this info from just one table , is there a way out
According to your requirements, you may be missing some table(s) holding the cost of the item and bonus quantity.
Show us your query, describe all tables,...
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
Click Here to Expand Forum to Full Width