简体   繁体   中英

Microsoft Access won't show query if date is empty?

--SOLVED--

I'm having a problem with a query in Microsoft Access.

I need this query to show a list of entries where a specific Date field is empty . So it must sort and still show all the data, but only for entries where that specific date is missing.

There are a lot of dates in the table.

When I create a filter or just add criteria to the specific field in "Design View", it runs the query but it's empty without fail every time.

The field format is naturally a "Date" type field in the table.

I hope anyone can help me.

Thank you.

SQL BELOW:

SELECT rptClaimDateEmpty.Claim_Date, *
FROM (SELECT tblContainers.*, tbluCommodities.Commodity, 
tbluContainerSizes.ContainerSize, tbluCountryOfLoading.CountryOfLoading, 
tbluCountryOfOrigin.CountryOfOrigin, tbluShippers.Shipper, 
tbluShippingLines.ShippingLine, tbluPortOfLoading.PortOfLoading, 
tblBOLDates.BOLNumber FROM tblBOLDates INNER JOIN (tbluPortOfLoading RIGHT 
JOIN (tbluShippingLines RIGHT JOIN (tbluShippers RIGHT JOIN 
(tbluCountryOfOrigin RIGHT JOIN (tbluCountryOfLoading RIGHT JOIN 
(tbluContainerSizes RIGHT JOIN (tbluCommodities RIGHT JOIN tblContainers ON 
tbluCommodities.CommodityID = tblContainers.CommodityID) ON 
tbluContainerSizes.ContainerSizeID = tblContainers.Container_SizeID) ON 
tbluCountryOfLoading.CountryOfLoadingID = 
tblContainers.Country_of_LoadingID) ON tbluCountryOfOrigin.CountryOfOriginID 
= tblContainers.Country_of_OriginID) ON tbluShippers.ShipperID = 
tblContainers.ShipperID) ON tbluShippingLines.ShippingLineID = 
tblContainers.Shipping_LineID) ON tbluPortOfLoading.PortOfLoadingID = 
tblContainers.Port_of_LoadingID) ON tblBOLDates.BOLDateID = 
tblContainers.BOLDateID)  AS rptClaimDateEmpty;

I just need it to sort via the the "Claim Date" field where "Claim Date" is empty.

Wouldn't it just be:

SELECT *
FROM (...) AS rptClaimDateEmpty
WHERE rptClaimDateEmpty.Claim_Date Is Null;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM