Skip to Content
0
Former Member
Jan 05, 2009 at 06:51 AM

Using Decode in where clause in free hand sql

40 Views

Hi,

I want to use decode in free hand sql.

for eg : this is a where condition

Outlet_Lookup.City = @variable('Enter City')

Requirement :

if we put the user prompt as "Enter City and % for all cities"

and the user enters % then the data display should be all cities or else it shld be the specific city entered in the prmpt..

Can we do that using Decode statement,

I have tried

Outlet_Lookup.City = Decode(@variable('Enter City'),'%',Outlet_Lookup.City,(@variable('Enter City')))

This is not working....

Pls guide on the same..

Thanks.