------=_NextPart_000_06A4_01BF7152.F0DD5FC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have a project for the day.
My accounting person needs:
A tax report. I am trying to come up with a SQL Query for SQL 6.5
It needs to show:
(from 5 different taxid)
Amount Invoiced Before Taxes
Amount Of Taxes Invoiced
Total Amount Inoviced (Including taxes)
An added benifit would be:
Amount of taxes collected for month per TaxID
So what I need is:
A SQL query to take all invoices from "month" (ie. dates between =
01/01/2000 and 01/31/2000)
and show for each TaxID
Amount Invoiced - Pre Tax
Amount Invoiced - Tax
Amount Inoviced - Total
What I have so far: (pieced together from prior SQL query talks)
/* tax summary for month by taxid */
set nocount on
declare @begindate char(10), @enddate char(10)
select @begindate =3D '1/1/2000'
select @enddate =3D '1/31/2000'
set nocount off
/* get the inovices for dates */
select * from invoices
where date >=3D @begindate and date < @enddate
and type <> "void"
and amount <> 0
Now the problem... The INVOICES table does not show TaxID
It does show Amount (this includes the =
tax, but does not show which tax)
it does show Tax and Tax2 (I do have one =
TaxID that uses Tax2)
When I run the query above, it gives me the InvoiceID which I can then =
use to pull the TaxID from table InvoiceItems...
But having little experiance with SQL, I do not userstand how to make =
this all happen..
With help from everyone, I think we could piece this all together and =
make a SQL query that would be of use to everyone...
Thanks,
Ken
Kenneth Gustav Eitenmiller Jr
Network Support Specialist
keitenmiller@hughestech.net
----------------------------------------------
www.hughestech.net
Hughes Business Technologies
7825 Forest Hills Road
Rockford, Illinois 61111
815-282-5151
815-282-5529 FAX=20
------=_NextPart_000_06A4_01BF7152.F0DD5FC0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">