I have a typical Stored Procedure using a Where clause and Max(Update_Date) subquery. I need to conditional NOT use the Max(Update_Date) query, completely by-pass it. I haven't written a query like this before and unsure how to proceed, help...
1. If @myVariableString is empty, then use the Max(Update_Date) query
2. If @myVariableString not empty, then by-pass the Max(Update_Date) query all together.
From Advertising a
Where Case When @myVariableString = ''
Then Update_Date = (Select Max(Update_Date)
From Advertising b
Where a.Name = b.Name)