I have a records like below :
Name Count
123456M2.txt NULL
123456M2.txt 15
123456M.txt NULL
- First record shoud show me NULL, as there is a number after "M" letter in name and Count < 0
- Second record shoud show me 1, and there is a number after "M" letter in name and Count > 0
- Third record should show me "some number from another field" as, there is no number after "M" letter in name.
Can you guide me on how to write this query.
I am able to do CASE - WHEN query, but not able to proceed with IF ELSE condition of letter check
CASE
WHEN CHARINDEX('M', [FILE_NAME]) > 0 THEN 'COUNT'
Case...Whenstructure. If you want further assistance, I would suggest you edit your question to include sample data