-----Original Message-----
Dear Marko:
I've edited your query a bit to study it:
SELECT L.[Student Name], L.[Book Number], L.[Loan Date],
DateAdd("m", 1, [L,Loan Date]) +
IIf(Weekday(DateAdd("m", 1, L.[Loan Date]),2) < 6, 0, 8 -
Weekday(DateAdd("m", 1, L.[Loan Date]), 2)) AS [Loan Due],
L.[Loan Returned], DateDiff("d", L.[Loan Due], L. [Loan Returned])
AS DaysLate, F.finAmount
FROM Loan L, Fines F;
One problem would be that you do not have a JOIN between Loan and
Fines. Now, how this should be done depends on how your database is
constructed. There would need to be a unique key (perhaps the Primary
Key) to Loan on which to base the relationship between these two
tables. I would suggest perhaps that might be:
Student Name
Book Number
Loan Date
This would presume that no student would check out the same book twice
on the same day. I'm not sure that's a sefe assumption, but given the
columns you show here, that's the closest thing I can see to something
that uniquely identifies a Loan.
Because of this, I'm thinking what you have is possibly a table design
problem. The ability to associate a Fine with a specific Loan is
definitely dependent on the fundamental design of the tables.
You may need to disclose more details of your table design if you feel
it is already adequate for the task, or you may want to get some
guidance on making it functional if it is not.
Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
My SQL is - SELECT Loan.[Student Name], Loan.[Book
Number], Loan.[Loan Date], DateAdd("m",1,[Loan Date]) +IIf
(Weekday(DateAdd("m",1,[Loan Date]),2)<6,0,8-Weekday
(DateAdd("m",1,[Loan Date]),2)) AS [Loan Due], Loan. [Loan
Returned], DateDiff("d",[Loan Due],[Loan Returned]) AS
DaysLate, Fines.finAmount
FROM Loan, Fines;
can you help
.