473,548 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access 97 query last value

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
2 4120
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*********@te lenet.bewrote in message
news:11******** **************@ q2g2000cwa.goog legroups.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
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.>

tblMediaMovemen t
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*********@te lenet.bewrote in message
news:11******** **************@ q2g2000cwa.goog legroups.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
5389
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB 7.2 environment, the choices the optimizer makes often seem flaky. But this last example really floored me. I was hoping someone could explain why...
6
4448
by: Jarrod | last post by:
I have multiple reports in one database, on one form. I need to know what reports were run when, and by Network User ID. How do I do that?
1
5090
by: Thats Me | last post by:
TMALSS: Task With maintenance of Access Database I did not develop, don't ask about non-commented code problems or where data dictionary is (LOL). Have table with Inventory data for all Publications held, contains binder number on shelf and is text data in numeric/alpha form i.e.; 123, 1234, 123a, 1234c. I want to stuff the last...
5
2927
by: m_t_hill | last post by:
Running MS Access 2000 MS Windows XP Pro This has caused me a lot of hair loss in the last few days so would appreciate any help. I am running code to append/update a local access database from a remote MS SQL database. The method of determining which records to append is primarily using the last date an update was carried out; I...
4
2654
by: ShastriX | last post by:
Getting a weird error while trying out a query from Access 2003 on a SQL Server 2005 table. Want to compute the amount of leave taken by an emp during the year. Since an emp might be off for half a day (forenoon or afternoon), have the following computed field: SessionOff: ( And ) The query works fine when there's no criterion on...
3
2211
by: stuart.medlin | last post by:
I have an Access 97 application that has a basic form (Transcript) and subform. The subform has a query as a recordsource that returns records from a table: SELECT DISTINCTROW Transcript.NCID, Transcript.TransCode, Transcript.TransMM, Transcript.TransYY, Transcript.DateKeyed, Transcript.UserID FROM Transcript WHERE datekeyed >=...
3
1603
by: fperri | last post by:
Hello, I have a calculated field in my query that uses a function to come up with the value. The function has various fields from the table used in the query passed into it as parameters. For some reason, it pulls the values of a few of the fields for a few of the parameters, but for the others it is assigning the parameter the value of zero...
1
19386
MMcCarthy
by: MMcCarthy | last post by:
Access has a number of built-in functions which can be generally used in queries or VBA code. Some of the more common ones are: Note: anything in square brackets is optional Date Functions Date() - Returns the current system date Now() - Returns the current system timestamp (date and time)
13
1859
by: Mike1961 | last post by:
Hi everyone. I have this query ASP and Db Access: strSql = "SELECT Last(ID) AS ID, " &_ "A, " &_ "B, " &_ "C, " &_ "COUNT(D) AS TotD, " &_ "Last(D) AS D, "&_
0
7512
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6036
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.