Yes, I checked all the data for Null values and Empty fields. There are none. FYI, the filters I am talking about are in the column headers of the table. To refresh your memory, this is a quote from my first post with a little bit added at the end: "If I chose to show all dates for the month, half of my columns won't filter. That capability just goes away. BUT if I just chose two weeks of data, ANY two weeks, the filter option is there in all columns."
Here is the SQL:
INSERT INTO tblPermianCodesDetailReportWthDates ( ORG_SEQNO, DOWNTIME_DATE, AUTOMATION_NAME, DOWNTIME_CD, DOWNTIME_DESC, Type, [Permian Category], HOURS_DOWN, LOST_OIL, LOST_GAS )
SELECT ODS_WELLCOMP.ORG_SEQNO, ODS_DOWNTIME_DETAILS.DOWNTIME_DATE, ODS_WELLCOMP.AUTOMATION_NAME, ODS_DOWNTIME_DETAILS.DOWNTIME_CD, ODS_DOWNTIME_CODES.DOWNTIME_DESC, tblCodeType.Type, ODS_DOWNTIME_CODES.CATEGORY, Sum(ODS_DOWNTIME_DETAILS.HOURS_DOWN) AS HOURS_DOWN, Sum(ODS_DOWNTIME_DETAILS.LOST_OIL_VOL) AS LOST_OIL, Sum(ODS_DOWNTIME_DETAILS.LOST_GAS_VOL) AS LOST_GAS
FROM ((ODS_DOWNTIME_DETAILS INNER JOIN ODS_WELLCOMP ON ODS_DOWNTIME_DETAILS.API_NO14 = ODS_WELLCOMP.API_NO14) INNER JOIN ODS_DOWNTIME_CODES ON ODS_DOWNTIME_DETAILS.DOWNTIME_CD = ODS_DOWNTIME_CODES.DOWNTIME_CD) INNER JOIN tblCodeType ON ODS_DOWNTIME_CODES.DOWNTIME_CD = tblCodeType.Code
WHERE (((ODS_DOWNTIME_DETAILS.DOWNTIME_DATE) Between #1/1/2014# And #1/31/2014#) AND ((ODS_DOWNTIME_DETAILS.DOWNTIME_CD) Not Like 'Z*') AND ((ODS_DOWNTIME_DETAILS.API_NO14) Like '30025233090000'))
GROUP BY ODS_WELLCOMP.ORG_SEQNO, ODS_DOWNTIME_DETAILS.DOWNTIME_DATE, ODS_WELLCOMP.AUTOMATION_NAME, ODS_DOWNTIME_DETAILS.DOWNTIME_CD, ODS_DOWNTIME_CODES.DOWNTIME_DESC, tblCodeType.Type, ODS_DOWNTIME_CODES.CATEGORY
ORDER BY ODS_WELLCOMP.AUTOMATION_NAME, ODS_DOWNTIME_CODES.CATEGORY;
Dan Rogotzke
Daniel_Rogotzke@oxy.com