Re: [Emerald] I need a query

( dan@dmn.com.au )
Fri, 18 Feb 2000 09:27:46 +0800

select Top 1 ma.customerid,ma.lastname,ma.firstname,inv.Invoiceid from
invoices
inv, masteraccounts ma where inv.customerid=ma.customerid and type='void'
order by inv.Date desc

Regards,

Dan Tang
Domain Technology
========================================================
========================================================
----- Original Message -----
From: "Nathan Haywood" <nhaywood@whro.org>
To: <emerald@iea-software.com>
Sent: Friday, February 18, 2000 4:23 AM
Subject: RE: [Emerald] I need a query

> Oops... forgot a line...
>
> SELECT ma.CustomerID AS CustomerID,
> MAX(ma.LastName) AS LastName,
> MAX(ma.FirstName) AS FirstName,
> MAX(inv.InvoiceID) AS InvoiceID
> FROM Invoices inv
> JOIN MasterAccounts ma
> ON inv.CustomerID = ma.CustomerID
> WHERE inv.Type <> 'VOID'
> GROUP BY ma.CustomerID
> ORDER BY LastName, FirstName, CustomerID
>
> Nathan Haywood
>
> -----Original Message-----
> From: Nathan Haywood [mailto:nhaywood@whro.org]
> Sent: Thursday, February 17, 2000 2:54 PM
> To: 'emerald@iea-software.com'
> Subject: RE: [Emerald] I need a query
>
>
> Try this...
>
> SELECT ma.CustomerID AS CustomerID,
> MAX(ma.LastName) AS LastName,
> MAX(ma.FirstName) AS FirstName,
> MAX(inv.InvoiceID) AS InvoiceID
> FROM Invoices inv
> JOIN MasterAccounts ma
> ON inv.CustomerID = ma.CustomerID
> GROUP BY ma.CustomerID
> ORDER BY LastName, FirstName, CustomerID
>
> Nathan Haywood
>
>
> -----Original Message-----
> From: Duane Schaub [mailto:dschaub@terraworld.net]
> Sent: Thursday, February 17, 2000 11:48 AM
> To: emerald@iea-software.com
> Subject: RE: [Emerald] I need a query
>
>
> Thank, but this will list all invoices > '11/2/99'. I specifically need
> only the last one. That is the part that I am having the problem with.
>
>
> Duane.
>
> -----Original Message-----
> From: emerald-request@iea-software.com
> [mailto:emerald-request@iea-software.com]On Behalf Of Dan Tang
> Sent: Thursday, February 17, 2000 10:13 AM
> To: emerald@iea-software.com
> Subject: Re: [Emerald] I need a query
>
>
> select ma.customerid,ma.lastname,ma.firstname,inv.Invoiceid from invoices
> inv, masteraccounts ma where inv.customerid=ma.customerid and type='void'
> and inv.date>'11/2/99'
>
>
> -----Original Message-----
> From: Duane Schaub <dschaub@terraworld.net>
> To: Emerald List <emerald@iea-software.com>
> Date: Friday, February 18, 2000 12:05 AM
> Subject: [Emerald] I need a query
>
>
> >Anyone, please help: (SQL7)
> >
> >I need a query to list customerid, lastname, firstname, (most recent
> >non-void invoice)
> >
> >
> >
> >
> >
> >======================================================================
> >Duane Schaub, President |Terra World, Inc - Connecting The Planet
> >Terra World, Inc. |Southeast Kansas' Leading Provider
> >200 Arco Place, Suite 252 |Flat Fee - Never an hourly Charge
> >Independence, Kansas 67301 |Where Service is Top Priority!
> >Voice (316) 332-1616 |http://www.terraworld.net
> >FAX: (316) 332-1451 |dschaub@terraworld.net
> >======================================================================
> >
> >
> >For more information about this list (including removal) go to:
> >http://www.iea-software.com/support/maillists/liststart
>
>
> For more information about this list (including removal) go to:
> http://www.iea-software.com/support/maillists/liststart
>
>
> For more information about this list (including removal) go to:
> http://www.iea-software.com/support/maillists/liststart
>
> For more information about this list (including removal) go to:
> http://www.iea-software.com/support/maillists/liststart
>
> For more information about this list (including removal) go to:
> http://www.iea-software.com/support/maillists/liststart

For more information about this list (including removal) go to:
http://www.iea-software.com/support/maillists/liststart