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
 General SQL Server Forums
 New to SQL Server Programming
 Compare statement

Author  Topic 

kulfi
Starting Member

33 Posts

Posted - 2011-04-05 : 00:33:14
Hi,
When i am executing this query i get a value from the table [Vacation Schedule] where Employee_ID is equal to the value i entered in a Text box Scr_Empl_Numb

Now i want to check that either these two values return are same or not

the value return by the query is SCR
and the value i enterd in the text box is SCR


But when i make the compare statment it fails can u please guide how can i do this.

Thanks

Ehsan

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2011-04-05 : 01:06:34
you can compare results using your application. it would be much better that doing this in SQL. If however you decide to do this in SQL, try a simple example like:

case when Query_SRC = text_box_SRC then 'Same' else 'Different' end
Go to Top of Page
   

- Advertisement -