SQL QUERY
-
hi, i have a very simple problem....i have a ms access database. I have a windows form, which has two textboxes(name and depid) and a combobox(department),i want to write a query that will search all these using WHERE and LIKE.ie i need to create a function by the name search and use the query so that this will search all these...i am new to sql...expecting your help Thanks in advance, JAN
-
hi, i have a very simple problem....i have a ms access database. I have a windows form, which has two textboxes(name and depid) and a combobox(department),i want to write a query that will search all these using WHERE and LIKE.ie i need to create a function by the name search and use the query so that this will search all these...i am new to sql...expecting your help Thanks in advance, JAN
-
select * from where name ='deptname' and depid='1' -- instead value 1 on depid set another id
for more help describe your problem much more.
I Love SQL
hi, i have three layers. 1)form.cs 2)datalayer 3)database(forget about this since it is used to open and close the connections form the ms access) i have two text and a single combobox. basic idea is i want a query that will search even if any one of these fields are selected. also do the same if two are selected. also do the same if one is selected. the code to search will have to be on my btn click for serach event(ie is in layer form1.cs). it will have to call my query that will be in a fn: that is in datalayer ( public DataTable refinesearch(string searchstr1, string s2, string s3) so i think i need to use "like" condition. something like "select * from Employee(name of the table) where name like "string" where empid like "s2" etc........ this is my problem .i do not know the query. thanking you and expecting your reply.... J
-
hi, i have three layers. 1)form.cs 2)datalayer 3)database(forget about this since it is used to open and close the connections form the ms access) i have two text and a single combobox. basic idea is i want a query that will search even if any one of these fields are selected. also do the same if two are selected. also do the same if one is selected. the code to search will have to be on my btn click for serach event(ie is in layer form1.cs). it will have to call my query that will be in a fn: that is in datalayer ( public DataTable refinesearch(string searchstr1, string s2, string s3) so i think i need to use "like" condition. something like "select * from Employee(name of the table) where name like "string" where empid like "s2" etc........ this is my problem .i do not know the query. thanking you and expecting your reply.... J
if datatype of column EmpId is integer then you can not use
like
statement just>,<,=,<>
but if column EmpId is varchar then you can uselike
statement --if empid is integerselect * from Employee where name like '%string%' and empid=1
--if empid is varcharselect * from Employee where name like '%string%' and empid like '%1%'
-- modified at 11:38 Saturday 13th October, 2007
I Love SQL
-
if datatype of column EmpId is integer then you can not use
like
statement just>,<,=,<>
but if column EmpId is varchar then you can uselike
statement --if empid is integerselect * from Employee where name like '%string%' and empid=1
--if empid is varcharselect * from Employee where name like '%string%' and empid like '%1%'
-- modified at 11:38 Saturday 13th October, 2007
I Love SQL
Hi, Thankyou Blue_Boy .it worked fine. Thanks a lot for your time.... Regards Jan
-
Hi, Thankyou Blue_Boy .it worked fine. Thanks a lot for your time.... Regards Jan