Я недавно пытался заархивировать свои данные в другую таблицу, чтобы моя рабочая таблица была меньше и с ней было проще работать. У меня есть запрос, который объединяет мою таблицу Clients с моими Trips table, чтобы мои отчеты могли получать данные из обеих таблиц.
Я вообще не понимаю SQL, но надеюсь, что это простое исправление, которое я смогу понять.Все, что я пробовал, было со ссылками в представлении «Дизайн», я ничего не пробовал в представлении SQL.
Если требуется дополнительная информация, пожалуйста, спросите меня об этом, поскольку я не совсем уверен, что мне нужнодача.
SELECT clients1.clientid,
clients1.client,
trip.DATE,
clients1.contactname,
clients1.address,
clients1.town,
clients1.county,
clients1.[post code],
clients1.phonenumber,
clients1.[mobile number],
trip.vehicle,
trip.tripid,
trip.[pick up],
trip.return,
trip.destination,
trip.startpoint,
trip.startmileage,
trip.finishmileage,
trip.driver,
trip.price,
trip.method,
trip.invoice,
trip.paid,
trip.extra,
trip.extracost,
[startpoint] & " to " & [destination] AS Trip,
trip.invoicedate,
trip.wheelchair,
trip.babyseat,
trip.pushchairs,
trip.paymentslipno,
[price] + [extracost] AS TripCost,
trip.[not shown on contacts],
trip.[extras vat],
trip.vat,
trip.[extras vat],
[trip archive 2015 & 2016].tripid,
[trip archive 2015 & 2016].DATE,
[trip archive 2015 & 2016].clientid,
[trip archive 2015 & 2016].[pick up],
[trip archive 2015 & 2016].return,
[trip archive 2015 & 2016].startpoint,
[trip archive 2015 & 2016].destination,
[trip archive 2015 & 2016].driver,
[trip archive 2015 & 2016].vehicle,
[trip archive 2015 & 2016].startmileage,
[trip archive 2015 & 2016].finishmileage,
[trip archive 2015 & 2016].invoice,
[trip archive 2015 & 2016].price,
[trip archive 2015 & 2016].vat,
[trip archive 2015 & 2016].extracost,
[trip archive 2015 & 2016].[extras vat],
[trip archive 2015 & 2016].method,
[trip archive 2015 & 2016].sent,
[trip archive 2015 & 2016].paid,
[trip archive 2015 & 2016].invoicedate,
[trip archive 2015 & 2016].notes,
[trip archive 2015 & 2016].extra,
[trip archive 2015 & 2016].paymentslipno,
[trip archive 2015 & 2016].wheelchair,
[trip archive 2015 & 2016].babyseat,
[trip archive 2015 & 2016].passengers,
[trip archive 2015 & 2016].pushchairs,
[trip archive 2015 & 2016].[not shown on contacts]
FROM (clients1
INNER JOIN trip
ON clients1.clientid = trip.clientid)
INNER JOIN [trip archive 2015 & 2016]
ON clients1.clientid = [trip archive 2015 & 2016].clientid
WHERE (( ( trip.invoice ) LIKE "*" & [enter invoice no:] & "*" ))
ORDER BY clients1.client,
trip.DATE,
trip.tripid;