Using SQL 2000 Stored Procedures I needed to pass an ALL parameter back to CR9. I couldnt find any information on this for SQL. I borrowed and altered an idea from a friend and it seems to work just great.
Can anyone think of any reason why this might not work?
I created a temp table and put this code between the Where Statement and Select from temp table statement. I am doing this on two parameters so the user can choose a specific item or have them all appear.
Can anyone think of any reason why this might not work?
I created a temp table and put this code between the Where Statement and Select from temp table statement. I am doing this on two parameters so the user can choose a specific item or have them all appear.
Code:
WHERE PROV_CRED_PEND.Date_pend IS NOT NULL
AND PROV_CRED_PEND.Date_unpend IS NULL
AND GETDATE() between Vendor.EFF_DATE and Vendor.EXP_DATE
IF @STAT NOT LIKE 'ALL' DELETE FROM #CS WHERE CREDSTAT NOT LIKE @STAT
IF @PROD NOT LIKE 'ALL' DELETE FROM #CS WHERE PRODUCT NOT LIKE @PROD
SELECT * FROM #CS