K
Kristibaer
I have a query that has a field with a calculation that is a sum of two other
fields. I also have another field that detirmines the type of item within a
record, specifically stocking(displays as -1) and non-stocking (displays as
0).
Have tried variations of IIF([immaster].[stocking] = 0, 0,
[Field1]+[Field2])
in criteria of fileds and as new fields, but my record count changes from
20,783 to 382 or I get no results.
Is there an expression I can use in the criteria of the field that is the
sum of two fields that will default the sum result to zero if the item type
field is non-stocking? Here is the SQL statement if this helps explain what
I am trying to do:
SELECT [PI Freeze].item, [PI Freeze].descrip, [PI Freeze].prodclas,
immaster.stocking, [PI Freeze].[Freeze Qty], [MAST CNT].Count, Nz([MAST
CNT].[Count],0) AS [Count Qty], ([Count Qty]-[PI Freeze].[Freeze Qty]) AS
[Variance Qty]
FROM ([PI Freeze] LEFT JOIN [MAST CNT] ON [PI Freeze].item = [MAST
CNT].item) INNER JOIN immaster ON [PI Freeze].item = immaster.item
GROUP BY [PI Freeze].item, [PI Freeze].descrip, [PI Freeze].prodclas,
immaster.stocking, [PI Freeze].[Freeze Qty], [MAST CNT].Count, Nz([MAST
CNT].[Count],0), ([Count Qty]-[PI Freeze].[Freeze Qty]);
Not quite sure how to create this in a new column.
thanks,
Kristi
fields. I also have another field that detirmines the type of item within a
record, specifically stocking(displays as -1) and non-stocking (displays as
0).
Have tried variations of IIF([immaster].[stocking] = 0, 0,
[Field1]+[Field2])
in criteria of fileds and as new fields, but my record count changes from
20,783 to 382 or I get no results.
Is there an expression I can use in the criteria of the field that is the
sum of two fields that will default the sum result to zero if the item type
field is non-stocking? Here is the SQL statement if this helps explain what
I am trying to do:
SELECT [PI Freeze].item, [PI Freeze].descrip, [PI Freeze].prodclas,
immaster.stocking, [PI Freeze].[Freeze Qty], [MAST CNT].Count, Nz([MAST
CNT].[Count],0) AS [Count Qty], ([Count Qty]-[PI Freeze].[Freeze Qty]) AS
[Variance Qty]
FROM ([PI Freeze] LEFT JOIN [MAST CNT] ON [PI Freeze].item = [MAST
CNT].item) INNER JOIN immaster ON [PI Freeze].item = immaster.item
GROUP BY [PI Freeze].item, [PI Freeze].descrip, [PI Freeze].prodclas,
immaster.stocking, [PI Freeze].[Freeze Qty], [MAST CNT].Count, Nz([MAST
CNT].[Count],0), ([Count Qty]-[PI Freeze].[Freeze Qty]);
Not quite sure how to create this in a new column.
thanks,
Kristi