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
 need help mixing a couple of queries into one quer

Author  Topic 

weitzhandler
Yak Posting Veteran

64 Posts

Posted - 2008-01-26 : 20:22:02
I want to create a filtered view according to some information provides.
for example I want to create in form 2 check boxes male and female and when either both or one of them is unchecked, the query filters out the unchecked content from view according to the other filtering conditions.

the exact thing I need is:
a text box for string looking (in a specific column).
male & female checkboxes.
two datetime textboxes to specify a range to focus in.

it is very important to me, so if you misunderstood my question, please contact me.

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-01-28 : 05:14:46
What client side platform are you using?


Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

weitzhandler
Yak Posting Veteran

64 Posts

Posted - 2008-01-28 : 23:25:24
I use a dataset file in a win-form C# project.
this query works well but unfurtonately, when I use it within a table adapter query builder, I see an error message "Wrong parameter":
SELECT  EntryID, UserInfo, Kind, ActionDate, Span, SalaryAtAction
FROM Logbook
WHERE ((CASE WHEN @Enter = 0 AND @Exit = 0 THEN 0 WHEN @Enter = 1 AND @Exit = 0 AND kind = '?????' THEN 1 WHEN @Enter = 0 AND @Exit = 1 AND
kind = '?????' THEN 1 WHEN @Enter = 1 AND @exit = 1 AND kind IN ('?????', '?????') THEN 1 ELSE 0 END) = 1)


the problem is not in the sql syntax but in the table adapter.
you may either know about another various of this query or know to play with the table adapter.

notice that I use ssce

Shimi
Go to Top of Page
   

- Advertisement -