Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 sql

Author  Topic 

programer
Posting Yak Master

221 Posts

Posted - 2010-09-27 : 15:11:21
SELECT ID, UserId, IdSifra, Priimek, Ime, Posta, Kraj, Delovno_mesto FROM dbo.tbl_zaposleni Where First=@First or Last=@Last

My parameter is First and Last.

I've used "or"
But does not work.

Personal data:
Id, First, Last
1 test1 test2
2 test3 test4

If I want to find information in the fields "First", works, but if the first field, leave blank
and I in another field "Last" to find information but does not work.

Why not?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-09-28 : 11:27:50
How do you pass the values to the parameters?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -