Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am trying to load the data from the SQL Server using where clause as per the below
LOAD EmployeeID,
LastName,
FirstName,
Title,
SQL SELECT *
FROM Northwind.dbo.Employees
WHERE Country ='UK';
Can anyone please suggest ho to use <>(not equal to) condition with where clause for example if i need to load as per the below statement
LOAD EmployeeID,
LastName,
FirstName,
Title,
SQL SELECT *
FROM Northwind.dbo.Employees
WHERE Country <>'UK';
Thanking You
Vinayagam
Try like
LOAD EmployeeID,
LastName,
FirstName,
Title,
SQL SELECT *
FROM Northwind.dbo.Employees
WHERE NOT Country ='UK';
Try like
LOAD EmployeeID,
LastName,
FirstName,
Title,
SQL SELECT *
FROM Northwind.dbo.Employees
WHERE NOT Country ='UK';
The SQL Select statement is processed by SQL Server, not by Qlikview. But both <> and != should work fine in SQL Server T-SQL for not equal. You do have a comma after Title instead of a semicolon. So the load statement isn't correctly ended. That would cause an error no matter how correct your sql select statement is.
Where Country NOT IN ('UK');
You can use this way also
LOAD EmployeeID,
LastName,
FirstName,
Title,
SQL SELECT *
FROM Northwind.dbo.Employees
WHERE Country <>'UK';
it is working
Hai Frd,
U Just Try This One Replace Of <> (Not Equal to)
........
........
Where Country <> 'UK'
or
.............
.............
Where Not WildMatch(Country,'UK')
or
............
............
Where Not Country='UK'
Yup Thanks Guys i gndeed its grt help ....
Please close the thread by selecting correct/helpful answer.
Hi Vinayagam,
If you got correct/helpful answer from thread so mark this correct/helpful for others reference
Thanks & Best Regards
Maybe it's not important in you case, but I have to point out that all these solutions while excluding records where Country='UK' will also exclude records where Country is null. If you don't have null values in the Country field, you can of course use any of the above.
Regards,
Michael