Showing posts with label filter. Show all posts
Showing posts with label filter. Show all posts

Wednesday, March 28, 2012

how to use word and pdf filter in full text search (SQLServer2k5)

where to find and how to use full text search service to index word and pdf documents. please point me to a tutorial or give a step by step instruction. thanks for reading.http://www.codeproject.com/csharp/fulltextsearchingifinters.asp

How to use wildcard characters with control parameters

Hi guys,

I have a gridview and textbox. I can filter the grid just fine with the textbox, but I would like to allow the user to type in part of a name.

I thought something like this would work but it doesn't:

Emp_Name LIKE'%'+@.Emp_Name+'%'

Thank you.

That should work|||

That's what I thought too, but it doesn't. I guess I should give more info.

I am using an objectdatasource to populate the gridview. The object is a table adapter. It seems like the wildcards are completely ignored. If I am looking for smith, I can type smith and get the correct results. But if I type smit, nothing gets returned, though I want Smith to be returned. If I actually literally type the wildcard characters into the textbox the results are very unpredictable. Typing %smit% will return the correct result, as will %smi% But if I type %sm% then nothing gets returned. It seems as though the number of characters matter when doing this. And like I said, if I have'%'+@.Emp_Name+'%' in the actual query within the table adapter, the wildcards are ignored. Hopefully there is some kind of solution to this.

Thank you very much.

|||Anyone? Let me know if you need more information.

Monday, March 26, 2012

How to use the TOP(N) Filter syntax?

Im tearing my hair out on this one.
Could anyone provide information on how to use the "TOP(N)" filter syntax? I
want to return the top 10 aggregate rows. Not sure if it can do this?
Please help!
Thanks
TazYou mean like this:
SELECT TOP 500 Client.CLI_LastName
from Client
"Tarun Mistry" <nospam@.nospam.com> wrote in message
news:%235obeed0GHA.1268@.TK2MSFTNGP02.phx.gbl...
> Im tearing my hair out on this one.
> Could anyone provide information on how to use the "TOP(N)" filter syntax?
> I want to return the top 10 aggregate rows. Not sure if it can do this?
> Please help!
> Thanks
> Taz
>|||Just try something like this in your dataset
SELECT TOP (10) SomeField, COUNT(*) AS count
FROM SomeTable
GROUP BY SomeField
ORDER BY count DESC
That will count the number or rows pertaining to that specific field and
then put them in order by the count, showing only the top 10
"Tarun Mistry" <nospam@.nospam.com> wrote in message
news:%235obeed0GHA.1268@.TK2MSFTNGP02.phx.gbl...
> Im tearing my hair out on this one.
> Could anyone provide information on how to use the "TOP(N)" filter syntax?
> I want to return the top 10 aggregate rows. Not sure if it can do this?
> Please help!
> Thanks
> Taz
>|||Hi guys, thanks for the responses.
I cannot change my query, therefore the filtering has to happen after the
dataset has been returned. This is because below my chart I will sumamrise
ALL of the informarion, however I only want the chart to display the top 10
entires (or whatever).
I thought i could do something like..
Count(Field!MyAggregate.Value) Top N 10
However this didnt do anything (that I could see).
Kind Regards
Taz|||another option is two have 2 datasets, make them the exact same except add
the top N statement to the dataset related to the chart and then have your
second dataset without the top N for the summary information. You would
still get the same info but from 2 different datasets.
"Tarun Mistry" <nospam@.nospam.com> wrote in message
news:%23xy8bre0GHA.4648@.TK2MSFTNGP04.phx.gbl...
> Hi guys, thanks for the responses.
> I cannot change my query, therefore the filtering has to happen after the
> dataset has been returned. This is because below my chart I will
> sumamrise ALL of the informarion, however I only want the chart to display
> the top 10 entires (or whatever).
> I thought i could do something like..
> Count(Field!MyAggregate.Value) Top N 10
> However this didnt do anything (that I could see).
> Kind Regards
> Taz
>|||Many thanks for your help Ben,
your previous post was the one I needed to make me realise where I was going
wrong.
Thanks again,
Taz
"Ben Watts" <ben.watts@.aaronnickellhomes.com> wrote in message
news:OG$qsue0GHA.4044@.TK2MSFTNGP04.phx.gbl...
> another option is two have 2 datasets, make them the exact same except add
> the top N statement to the dataset related to the chart and then have your
> second dataset without the top N for the summary information. You would
> still get the same info but from 2 different datasets.
> "Tarun Mistry" <nospam@.nospam.com> wrote in message
> news:%23xy8bre0GHA.4648@.TK2MSFTNGP04.phx.gbl...
>> Hi guys, thanks for the responses.
>> I cannot change my query, therefore the filtering has to happen after the
>> dataset has been returned. This is because below my chart I will
>> sumamrise ALL of the informarion, however I only want the chart to
>> display the top 10 entires (or whatever).
>> I thought i could do something like..
>> Count(Field!MyAggregate.Value) Top N 10
>> However this didnt do anything (that I could see).
>> Kind Regards
>> Taz
>

Monday, March 19, 2012

how to use parameters in method (filter by parameter)

Hello!

I've begin to do a tutorial of this site: Working with Data in ASP.NET 2.0 c#, but in the 3. step I can't make something:

In this step I can't add parameterized methods to the TableAdapter. The problem come up when I want to add Sql query.

SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued
FROM Products
WHERE CategoryID = @.CategoryID

The error message:

Error in WHERE clause near'@.'.
Unable to parse query text.

So, how can i use parameter in this method?

tnx for the help

Simpson

Are you sure you are passing in the parameter values to the TableAdapter when calling in your code?

Thanks

|||Hi

I have the same problem have you found a solution.

Regards
Demetrios|||Hi

I have the same problem have you found a solution.

Regards
Demetrios|||Hi

I have the same problem have you found a solution.

Regards
Demetrios|||

Hi MaoBranca,

This might because the @.CategoryID was not declared properly.

If this is a SQL Server database, please make sure that you have added the parameter to the SqlCommand parameter collection. If it has been added, please also confirm that the data type, size and value are correct.

HTH. If this does not answer you question, please feel free to mark it as Not Answered and post your reply. Thanks!

|||i have found the solution

SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued
FROM Products
WHERE CategoryID = @.CategoryID

this works for sqlserver if you are using an access database then it is

SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued
FROM Products
WHERE CategoryID = ?

if you are using mysql then it is

SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued
FROM Products
WHERE CategoryID = #CategoryID

but i an not sure with mysql

Monday, March 12, 2012

How to use MDX script in RS dimension filter (dataview)

Hi, I need to create filter which retrieves data for current moment. [time].[date].lastchild is not an option because the calender in database is generated till following year (2008).

I guess script goes like..

[time].[date].currentmember

but it does not work.

I'm green with these MDX scripts.. I'd be very pleased if some one of you gurus could help me.

Best Regards,
Eeva

You can use StrToMember() for this, e.g.:

StrToMember ("[Date].[Calendar Date].[2003].[H" +

CStr(IIf(Month(Now()) <= 6, 1, 2)) + " CY 2003].[Q" +

CStr(DatePart("q", Now())) + " CY 2003].[" + Format(Now(), "MMMM") + "].[" +

Format(Now(), "MMMM") + " " + CStr(Day(Now())) + "]")

assuming Year-Half Year - Quarter - Month - Day user-defined hierarchy. If you use a special format for the Date dimension key, e.g. YYYYMMDD and you should, then you can simplify the above syntax and use the Day attribute hierarchy directly, e.g. [Date].[Day].[Day].&[20070323]

Friday, March 9, 2012

How to use iif in Filter expression

I am want to do a count distinct of an ID where fieldInt is not null in a table. This is how I am doing it... In Layout view, click the table, then right click Properties on Filters tab, for filter I do the following:

In Expression column: = Fields.fieldInt.Value

In Operator column: = !=

In Value: 'null'

But this is not working. How do I solve this problem.

try this.

IsDBNull(Fields.fieldInt.Value ) = false

|||

You can write this in the expression

= iif( Fields.Fieldint.value is nothing, 0, CountDistinct(Fields.Fieldint.value))

This should get you your count distinct where values are not null.

Hammer

Sunday, February 19, 2012

How to use a script to break or continue a For Each loop task?

Okay, I have a For each loop container that has an enumeration of folder locations. I run a script to filter the files in those folders and prepare them to the next task to be copy. I want the script to "continue" the loop if none of the files meet the criteria. Can someone point me into the right direction? I need some way to advance through the loop when this happens.

Thanks!

Not quite understanding your requirement but I think conditional precedence constraints will help you here: http://www.sqlis.com/default.aspx?306

-Jamie