By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,519 Members | 2,412 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,519 IT Pros & Developers. It's quick & easy.

Access 97 query last value

P: n/a
A table : Nameperson, Book nr, Bookdatein, Bookdateout, CD nr,
cddatein, cddateout, dvd nr, dvddatein, dvddateout.
I would like a query where a see the personsname en de last book with
the datein and out , the last cd with datein and out , and the same
for the dvd. Because the last time the person came he toke only a
book but dit not return his dvd (for example). But with one click i
would like to see the last of every item with the right dates.

Tx anyone, anywhere, anytime.

Feb 10 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
See:
Getting a related field from a GroupBy (total) query
at:
http://www.mvps.org/access/queries/qry0020.htm
for 4 ways to approach this.

The example is very similiar.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<da*********@telenet.bewrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
>A table : Nameperson, Book nr, Bookdatein, Bookdateout, CD nr,
cddatein, cddateout, dvd nr, dvddatein, dvddateout.
I would like a query where a see the personsname en de last book with
the datein and out , the last cd with datein and out , and the same
for the dvd. Because the last time the person came he toke only a
book but dit not return his dvd (for example). But with one click i
would like to see the last of every item with the right dates.

Tx anyone, anywhere, anytime.
Feb 10 '07 #2

P: n/a
suggest you take another look at your table structure. you've embedded data
in fieldnames (Book, CD, DVD), and have repeating groups (item, date in ,
date out). both are strong indications that your table is not normalized.
(for more information on normalization, see
http://home.att.net/~california.db/tips.html#aTip1.) this single table
should be broken into at least two, and i'd probably have a minimum of
three, as

tblPersons
PersonID (primary key, autonumber)
FirstName
LastName
<other fields that describe a person>

tblMediaTypes
MediaID (primary key, autonumber)
MediaName
<this table will have three records: Book, CD, DVD. if you have other media
as well, each type will be a single record in the table.>

tblMediaMovement
MoveID (primary key, autonumber)
PersonID (long integer, foreign key from tblPersons)
MediaID (long integer, fk from tblMediaTypes)
NR (i'm guessing this is a unique identifier for each item in
your...library? store? whatever)
DateIn
DateOut

with the correct table setup, a single Totals query will give you the "last"
item of each type, for each person.

actually, if this is a store or lending library of some kind, i'd probably
use a somewhat more elaborate setup, with the following tables, as

tblPersons
<each person who borrows items is listed as one record, with whatever
information you collect about your borrowers.>

tblMediaTypes
<a simple list of the types of media you loan, same as detailed above.>

tblItems
<a detailed list of each item that is loaned, including its' identifying
"nr", what media type it is, and all other details you want to track, such
as title, date purchased, cost.>

tblLoans
<each record is one instance of a loan of a specific item to a specific
person. to identify the person, use only the PersonID from tblPersons; to
identify the item, use only the ItemID from tblItems. include other data you
want to track, such as date out, due date, date in.>

hth
<da*********@telenet.bewrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
A table : Nameperson, Book nr, Bookdatein, Bookdateout, CD nr,
cddatein, cddateout, dvd nr, dvddatein, dvddateout.
I would like a query where a see the personsname en de last book with
the datein and out , the last cd with datein and out , and the same
for the dvd. Because the last time the person came he toke only a
book but dit not return his dvd (for example). But with one click i
would like to see the last of every item with the right dates.

Tx anyone, anywhere, anytime.

Feb 10 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.