D
Duncan
left out one other table:
Office Table
OfficeID
CorpID
OfficeName
BuildingID
OfficeAddress
OfficeCity
OfficeState
Hope all that helps some.
Office Table
OfficeID
CorpID
OfficeName
BuildingID
OfficeAddress
OfficeCity
OfficeState
Hope all that helps some.
-----Original Message-----
the query was created by Access: Here is the SQL:
PARAMETERS [Enter Lease ID #:] Long;
TRANSFORM Sum([Rent by Month].[RentAmount]) AS
SumOfRentAmount
SELECT [Leases].[LeaseID], [Leases].[Lessee], [Leases].
[Lessor], [Leases].[OfficeID], [Offices].[CorpID],
[Offices].[OfficeName], [Offices].[OfficeAddress],
[Offices].[OfficeCity], [Offices].[OfficeState], [Leases].
[Property Description], [Leases].[Begin Date], [Leases].
[End Date], [Leases].[Renewable], [Leases].[PaymentTerm],
[Leases].[Utilities], [Leases].[UtilitiesComments],
[Leases].[Insurance], [Leases].[LiabilityInsurance],
[Leases].[PropertyInsurance], [Leases]. [InsuranceDetails],
[Leases].[AdditionalComments], [Rent by Month].[Year],
[Leases].[InsuranceDetails], Sum([Rent by Month].
[RentAmount]) AS [Total Of RentAmount]
FROM (Offices INNER JOIN Leases ON [Offices].[OfficeID]=
[Leases].[OfficeID]) INNER JOIN [Rent by Month] ON
[Leases].[LeaseID]=[Rent by Month].[LeaseID]
WHERE ((([Leases].[LeaseID])=[Enter Lease ID #:])) Or
((([Enter Lease ID #:]) Is Null))
GROUP BY [Leases].[LeaseID], [Leases].[Lessee], [Leases].
[Lessor], [Leases].[OfficeID], [Offices].[CorpID],
[Offices].[OfficeName], [Offices].[OfficeAddress],
[Offices].[OfficeCity], [Offices].[OfficeState], [Leases].
[Property Description], [Leases].[Begin Date], [Leases].
[End Date], [Leases].[Renewable], [Leases].[PaymentTerm],
[Leases].[Utilities], [Leases].[UtilitiesComments],
[Leases].[Insurance], [Leases].[LiabilityInsurance],
[Leases].[PropertyInsurance], [Leases]. [InsuranceDetails],
[Leases].[AdditionalComments], [Rent by Month].[Year],
[Leases].[InsuranceDetails]
ORDER BY [Leases].[LeaseID], [Rent by Month].[Year], [Rent
by Month].[Month]
PIVOT [Rent by Month].[Month];
THe structure is this:
Leases Table Rent by Month Table
LeaseID LeaseID
Lessee Month
Lessor Year
OfficeID RentAmount
PropDescrip
BeginDate
EndDate
Renewable
PaymentTerm
Utilities
Utilities Comments
Insurance
Liability
Property
Insurance Details
Comments
.-----Original Message-----
Please share your table structure and SQL view.
--
Duane Hookom
MS Access MVP
.