L
laknight
I'm hoping someone can help me with this. I'm trying to NOT QUERY records
which have a null value if there is more than one record. I have posted the
SQL below, but the main fields are [PART],[DATE_CLOSED] and [JOB_NO].
Through the query I have requested the [JOB_NO] to display as Null if the
[DATE_CLOSED] is not #1/1/1900#. How can I take it a step further by saying
DO NOT display records for [PART] which have a [DATE_CLOSED] not #1/1/1900#
AND [JOB_NO] HAVING Count >1. I hope I said that right.
This is what I have:
PART DATE_CLOSE JOB_NO
A 10/24/2006 (Null)
B 10/25/2006 (Null)
B 1/1/1900 1234
B 1/1/1900 1235
B 1/1/1900 1236
This is what I NEED:
PART DATE_CLOSE JOB_NO
A 10/24/2006 (Null)
B 1/1/1900 1234
B 1/1/1900 1235
B 1/1/1900 1236
Here's the SQL I have currently (it is in Design View in Access)
SELECT V_INVENTORY_MSTR.PRODUCT_LINE AS [PR LINE], V_INVENTORY_MSTR.PART,
[QTY_ONHAND]-[QTY_REQUIRED] AS [NET AVAIL], V_JOB_HEADER.DATE_CLOSED,
IIf([DATE_CLOSED]=#1/1/1900#,[V_JOB_HEADER].[JOB],Null) AS JOB_NO
FROM (V_INVENTORY_MSTR LEFT JOIN V_ORDER_LINES ON V_INVENTORY_MSTR.PART =
V_ORDER_LINES.PART) LEFT JOIN V_JOB_HEADER ON V_INVENTORY_MSTR.PART =
V_JOB_HEADER.PART
GROUP BY V_INVENTORY_MSTR.PRODUCT_LINE, V_INVENTORY_MSTR.PART,
[QTY_ONHAND]-[QTY_REQUIRED], V_JOB_HEADER.DATE_CLOSED,
IIf([DATE_CLOSED]=#1/1/1900#,[V_JOB_HEADER].[JOB],Null)
HAVING (((V_INVENTORY_MSTR.PRODUCT_LINE)="17" Or
(V_INVENTORY_MSTR.PRODUCT_LINE)="19" Or (V_INVENTORY_MSTR.PRODUCT_LINE)="20"
Or (V_INVENTORY_MSTR.PRODUCT_LINE)="50" Or
(V_INVENTORY_MSTR.PRODUCT_LINE)="52") AND (([QTY_ONHAND]-[QTY_REQUIRED])<0))
ORDER BY V_INVENTORY_MSTR.PRODUCT_LINE, V_INVENTORY_MSTR.PART;
Thank you!
which have a null value if there is more than one record. I have posted the
SQL below, but the main fields are [PART],[DATE_CLOSED] and [JOB_NO].
Through the query I have requested the [JOB_NO] to display as Null if the
[DATE_CLOSED] is not #1/1/1900#. How can I take it a step further by saying
DO NOT display records for [PART] which have a [DATE_CLOSED] not #1/1/1900#
AND [JOB_NO] HAVING Count >1. I hope I said that right.
This is what I have:
PART DATE_CLOSE JOB_NO
A 10/24/2006 (Null)
B 10/25/2006 (Null)
B 1/1/1900 1234
B 1/1/1900 1235
B 1/1/1900 1236
This is what I NEED:
PART DATE_CLOSE JOB_NO
A 10/24/2006 (Null)
B 1/1/1900 1234
B 1/1/1900 1235
B 1/1/1900 1236
Here's the SQL I have currently (it is in Design View in Access)
SELECT V_INVENTORY_MSTR.PRODUCT_LINE AS [PR LINE], V_INVENTORY_MSTR.PART,
[QTY_ONHAND]-[QTY_REQUIRED] AS [NET AVAIL], V_JOB_HEADER.DATE_CLOSED,
IIf([DATE_CLOSED]=#1/1/1900#,[V_JOB_HEADER].[JOB],Null) AS JOB_NO
FROM (V_INVENTORY_MSTR LEFT JOIN V_ORDER_LINES ON V_INVENTORY_MSTR.PART =
V_ORDER_LINES.PART) LEFT JOIN V_JOB_HEADER ON V_INVENTORY_MSTR.PART =
V_JOB_HEADER.PART
GROUP BY V_INVENTORY_MSTR.PRODUCT_LINE, V_INVENTORY_MSTR.PART,
[QTY_ONHAND]-[QTY_REQUIRED], V_JOB_HEADER.DATE_CLOSED,
IIf([DATE_CLOSED]=#1/1/1900#,[V_JOB_HEADER].[JOB],Null)
HAVING (((V_INVENTORY_MSTR.PRODUCT_LINE)="17" Or
(V_INVENTORY_MSTR.PRODUCT_LINE)="19" Or (V_INVENTORY_MSTR.PRODUCT_LINE)="20"
Or (V_INVENTORY_MSTR.PRODUCT_LINE)="50" Or
(V_INVENTORY_MSTR.PRODUCT_LINE)="52") AND (([QTY_ONHAND]-[QTY_REQUIRED])<0))
ORDER BY V_INVENTORY_MSTR.PRODUCT_LINE, V_INVENTORY_MSTR.PART;
Thank you!