Code:
SELECT DISTINCTROW TblLicence.Id, TblLicence.PlantID, Plants.Cultivar, TblLicence.Nr, Profile.Display, TblLicence.ConType, TblLicence.LicHolder, TblLicence.ConExpireDate, TblLicence.Renewable, TblLicence.Breeder, TblLicence.Upfront, TblLicence.Royalty, TblLicence.MonthPay, TblLicence.Importer, TblLicence.Comment, TblLicence.NextPeriod, TblLicence.PlantBreederRights, TblLicence.PbrExpireDate, TblLicence.Origin, TblLicence.FirstCom, TblLicence.PbrGrantNo, TblLicence.Trademark, TblLicence.FirstComPlace, TblLicence.Supplier, TblLicence.ConSignDate, TblLicence.RenewableDate, TblLicence.PBROwner, TblPlantsPrices.Royalty, TblPlantsPrices.LevyFROM ((TblLicence INNER JOIN Profile ON TblLicence.Nr = Profile.Nr) INNER JOIN Plants ON TblLicence.PlantID = Plants.PlantID) LEFT JOIN TblPlantsPrices ON TblLicence.PlantID = TblPlantsPrices.PlantID;
Altered query, which does give an output, the newly created table(TblPBRVLInfo) does not have values yet so their columns are blank:
Code:
SELECT DISTINCTROW
TblLicence.Id,
TblLicence.PlantID,
Plants.Cultivar,
TblLicence.Nr,
Profile.Display,
TblLicence.ConType,
TblLicence.LicHolder,
TblLicence.ConExpireDate,
TblLicence.Renewable,
TblLicence.Breeder,
TblLicence.Upfront,
TblLicence.Royalty,
TblLicence.MonthPay,
TblLicence.Importer,
TblLicence.Comment,
TblLicence.AnnualRenewalDuty,
TblLicence.AnnualPBRRenewalCost,
TblLicence.AnnualPBRRenewalRequired,
TblLicence.NewPBRVLCost,
TblLicence.NextPeriod,
TblLicence.PlantBreederRights,
TblLicence.PbrExpireDate,
TblLicence.Origin,
TblLicence.FirstCom,
TblLicence.PbrGrantNo,
TblLicence.Trademark,
TblLicence.FirstComPlace,
TblLicence.Supplier,
TblLicence.ConSignDate,
TblLicence.RenewableDate,
TblLicence.PBROwner,
TblPlantsPrices.Royalty AS PriceRoyalty,
TblPlantsPrices.Levy AS PriceLevy,
TblPBRVLInfo.VL_ApplicationNo,
TblPBRVLInfo.VL_ApplicationDate,
TblPBRVLInfo.VL_GrantApprovalNo,
TblPBRVLInfo.VL_GrantApprovalDate,
TblPBRVLInfo.PBR_ApplicationNo,
TblPBRVLInfo.PBR_ApplicationDate,
TblPBRVLInfo.PBR_GrantNo,
TblPBRVLInfo.PBR_GrantApprovalDate,
TblPBRVLInfo.PBR_GrantExpiryDate,
TblPBRVLInfo.PBR_EndOfSoleRight
FROM
(
(
(TblLicence
INNER JOIN Profile
ON TblLicence.Nr = Profile.Nr
)
INNER JOIN Plants
ON TblLicence.PlantID = Plants.PlantID
)
LEFT JOIN TblPlantsPrices
ON TblLicence.PlantID = TblPlantsPrices.PlantID
)
LEFT JOIN TblPBRVLInfo
ON TblLicence.PlantID = TblPBRVLInfo.PlantID;