IIF Sataement

hart270

New Member
Joined
Aug 28, 2002
Messages
17
Can someone tell me what the IIF statement at the end of the select statement does?

SELECT [New Table].[TGT ETA (S/S)], [New Table].[Style Number], [New Table].Color, [New Table].Country, [New Table]![I70DOMINT] AS [DOM/INT], [New Table].Factory, [New Table].[Style Description], [New Table]![PSizes] AS [Photo sizes], [New Table].[Photo Qty], [New Table].[Date Photo due\TGT X-Date], [New Table].[Date Photo sent], [New Table].[Photo ETA], [New Table].[Date Photo rec'd], [New Table].Quantity, [New Table].[Number of Photo Rec'd], [New Table].[Expected Lot Completion Date S/S TGT X-Date], [New Table].[Actual Date Sent S/S], [New Table].[HAWB#], [WHP0110 Summary].[Max Of KRHDRC], [New Table].[Rec'd @ Office], [New Table]![Sizes] AS Sizes, [New Table].[Quantity Rec'd], [New Table]![I71CUT#] AS [PO/Cut#], [New Table].[Design Approved?], [WHP0110 Summary].[Max Of KRHDPS], [New Table].[Quantity Complete?], [New Table].Season, [New Table].Comments, IIf((IsNull([Max Of KRHDPS])),[TGT ETA (S/S)],[Max Of KRHDPS]) AS [Photo ETA1]

FROM [New Table] LEFT JOIN [WHP0110 Summary] ON ([New Table].[I71CUT#] = [WHP0110 Summary].KRHCUT) AND ([New Table].Season = [WHP0110 Summary].WHSEAYR)

WHERE ((([New Table].Season)=[Enter Season]))

ORDER BY [New Table].[TGT ETA (S/S)], [New Table].[Style Number];
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hullo. Basically, if the field [Max of KRHDPS] is null, you will see [TGT ETA (S/S)]. If it is NOT null, you'll see it's value.

HTH (y)

P
 
Upvote 0
What it does in the query is if Max of KRDPS is null it puts the TGT ETA (S/S) in the Max of KRHDPS Field. If it is not null it does not pull the record. What does the AS part do?
 
Upvote 0
The AS part just creates an alias name for that field and it is what shows up in the column header
 
Upvote 0

Forum statistics

Threads
1,221,586
Messages
6,160,646
Members
451,661
Latest member
hamdan17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top