Filter - Repost

D

D

Hi:

I have a report based on the below SQL; is there any way to display just the
new Invalid MI? what I mean is for example today I got 4 Invalid MI; what I
would like is that tomorrow to display just the new ones if any!!

Thanks,

Dan

SELECT DISTINCT ODSDBA_WATP1MIT.MENU_ITEM_CD, ODSDBA_WATP1MIT.MENU_ITEM_DSC,
ODSDBA_WATP1MIT.AMIL_FG, ODSDBA_WATP1MIT.MENU_ITEM_STS,
ODSDBA_WATS5MIX.DLY_UNT_SLS_QTY, ODSDBA_WATS5MIX.NATL_STR_NBR,
ODSDBA_WATS5MIX.DLY_SLS_DT, [DS Complete].[Site Description], [DS
Complete].City, [DS Complete].Prov, IIf([Owner Type]="M",[Business/Ops
Consultant],[Franchisee]) AS Expr1, IIf([Owner Type]="M","Ops.
Consultant","Franchisee") AS Expr2, IIf([dly_sls_dt]>[Comp],"Contact
Store","Store is ALIGNED") AS Expr3
FROM (ODSDBA_WATP1MIT INNER JOIN ODSDBA_WATS5MIX ON
ODSDBA_WATP1MIT.MENU_ITEM_CD=ODSDBA_WATS5MIX.MENU_ITM_NBR) INNER JOIN [DS
Complete] ON ODSDBA_WATS5MIX.NATL_STR_NBR=[DS Complete].[Natl#]
WHERE (((ODSDBA_WATP1MIT.AMIL_FG)="N") AND ((ODSDBA_WATP1MIT.MENU_ITEM_STS)
Not Like "T") AND ((IIf([dly_sls_dt]>[Comp],"Contact Store","Store is
ALIGNED")) Like "Contact Store"))
ORDER BY ODSDBA_WATS5MIX.DLY_SLS_DT DESC , IIf([dly_sls_dt]>[Comp],"Contact
Store","Store is ALIGNED");
 
M

[MVP] S.Clark

I'll start by commenting that the IIF() is not the best technique.

Other than that, you can use the Date() function to determine things that
happen on that day.

like: WHERE fieldname = Date()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Filter 4
New records 2
What will be the function? 2
Error: Too few paramenters 7
Croossab Query 5

Top