[Emerald] project for the day

Kenneth Gustav Eitenmiller Jr ( keitenmiller@hughestech.net )
Mon, 7 Feb 2000 10:06:02 -0600

This is a multi-part message in MIME format.

------=_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">

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