DineshSharma
5th May 2007, 12:11
Dear All,

We have One Customer and He has 10 delivery addresses in different states. Every states has issue seperate "C" form for purchasing the material.

We require the reports which shows the data on the basis on the delivery address.

How we seggregate the invoices on the basis of the delivery address. Because the SALES TAX CHARGES ON THE BASIS OF STATE in which we delivered the material.

Now, we face the problem for collecting the FORM "C". Because we print the sale data on cusotmerwise only.

Please suggest me, how it is possible.

Thanks & regards

Dksharma

nelsonR
7th May 2007, 18:01
To get the information, I created a query that links sales history data to the customer delivery address table. In there, the state we ship to is in com013.name

Since I use Oracle, the query is an oracle query but could be converted to SQL Server without any problems. The data is cut and pasted into an Excel Workbook where our finance department goes over it.

SELECT d.t$cuno "Cust#",
d.t$cdel "Del",
d.t$nama "Name",
d.t$name "Address",
b.t$orno "Order#",
(TO_NUMBER(TO_CHAR(b.t$invd,'yyyy'))) "InvYear",
b.t$invn "Inv#",
b.t$invd "InvDate",
b.t$item "Item",
c.t$dsca "Description",
b.t$cwar "Loc",
c.t$citg "I/G",
b.t$qana "Qty",
b.t$pric "Price",
b.t$amta "Amt$"
FROM baandb.ttdsls050300 a,
baandb.ttdsls051300 b,
baandb.ttiitm001300 c,
baandb.ttccom013300 d
WHERE ((b.t$item = c.t$item)
AND (a.t$orno = b.t$orno)
AND (a.t$cuno = d.t$cuno)
AND (a.t$cdel = d.t$cdel)
AND (d.t$name LIKE '%OH%')
AND (b.t$invn > 0))
ORDER BY d.t$cuno ASC, d.t$cdel ASC, b.t$item ASC