Re: [Emerald] project for the day

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

This is a multi-part message in MIME format.

------=_NextPart_000_0789_01BF715A.074FD150
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Maybe this will explain it better...

SQL Query follows....kinda

/* 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

select invoiceid from invoices
where date >=3D @begindate and date < @enddate
and type <> "void"
and amount <> 0

/* taxid from invoiceitems */
/* select taxid from above invoiceid in invoiceitems
if taxid =3D 1 then place in this virtual table (tax1)
if taxid =3D 2 then place in this virtual table (tax2)
if taxid =3D 3 then place in this virtual table (tax3)
if taxid =3D 4 then place in this virtual table (tax4)
if taxid =3D 5 then place in this virtual table (tax5)
if taxid =3D null then freakout

In virtual table (tax1) add all amounts
add all tax
add all tax2
bothtaxes =3D tax + tax2
amountsbeforetax =3D amounts - bothtaxes

print discription from virtual table (tax1)
print "Amount Invoiced before taxes =3D" amountsberforetax
print "Amount Invoiced taxes only =3D" bothtaxes
print "Amount Invoiced Total =3D" amounts

In virtual table (tax2) add....etc */

Ken

------=_NextPart_000_0789_01BF715A.074FD150
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Maybe this will explain it =better...
 
SQL Query follows....kinda
 
/* 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
 
select invoiceid from invoices
where =date >=3D=20@begindate and date < @enddate
 and type <> ="void"
 and=20amount <> 0
 

/* taxid from invoiceitems */
/* =select=20taxid from above invoiceid in invoiceitems
 if taxid =3D 1 then =place in=20this virtual table (tax1)
 if taxid =3D 2 then place in this =virtual table=20(tax2)
 if taxid =3D 3 then place in this virtual table =(tax3)
 if=20taxid =3D 4 then place in this virtual table (tax4)
 if taxid ==3D 5 then=20place in this virtual table (tax5)
 if taxid =3D null then=20freakout
 
In virtual table (tax1) add all=20amounts
   add all tax
   add all=20tax2
   bothtaxes =3D tax +=20tax2
   amountsbeforetax =3D amounts - =bothtaxes
 
print discription from virtual table=20(tax1)
print "Amount Invoiced before taxes =3D" =amountsberforetax
print=20"Amount Invoiced taxes only =3D" bothtaxes
print "Amount Invoiced =Total =3D"=20amounts
 
In virtual table (tax2) add....etc =*/
 
Ken
------=_NextPart_000_0789_01BF715A.074FD150--