Re: last, first, etc
- From: "George Nicholson" <JunkGeorgeN@xxxxxxx>
- Date: Mon, 10 Oct 2005 17:23:22 -0500
If you want smallest or largest value, use MIN and MAX.
FIRST and LAST will get you the values contained in the 1st and last records
which is only useful in a limited set of circumstances.
>From JETsql Help:
FIRST and LAST "...simply return the value of a specified field in the
first or last record, respectively, of the result set returned by a query.
Because records are usually returned in no particular order (unless the
query includes an ORDER BY clause), the records returned by these functions
will be arbitrary."
HTH,
--
George Nicholson
Remove 'Junk' from return address.
"The Iconoclast" <iconoclast2@xxxxxxxxxxx> wrote in message
news:urDHXZezFHA.3660@xxxxxxxxxxxxxxxxxxxxxxx
> Greetings!
> I have a table with the following fields:
> Product Quantity Price Date
> A 75 2.50 09/01/2005
> A 35 3.50 10/03/2005
> B 20 1.75 10/01/2005
> C 10 3.00 09/01/2005
> etc.
>
> I am trying to formulate a query such that based on a specified date (say
> 09/15/2005) only the corresponding price for that particular product would
> show up (i.e., A - 75 - 2.50 and C - 10 - 3.00). if the date were
> 10/05/2005
> then the display would show (A - 110 - 3.50; B - 20 - 1.75; C - 10 -
> 3.00).
> I've tries using the LAST aggregate function in the QBE but the results
> get
> jumbled up.
>
> Please help me. Thank you in advance.
>
>
.
- Prev by Date: Re: Sticky Toggle Button doesnt stay pressed down
- Next by Date: Re: Inconsistent query results
- Previous by thread: Re: elapsed days in query
- Next by thread: Re: last, first, etc
- Index(es):
Relevant Pages
|