PC Review


Reply
Thread Tools Rate Thread

Advanced filter criteria for <>

 
 
Dianne Butterworth
Guest
Posts: n/a
 
      22nd Aug 2007
I have coded a form for users to do filtering with on data that I pull
from an SQL Server database. I have a field "Invoice Number" which is a
varchar(255) column in SQL Server.

I have a criteria range with the column headings in the first row and
the cells below to fill with the criteria.

Invoice Number often contains numbers with leading zeros, for example
0005962. If I set my criteria for Invoice Number to 0005962 and apply my
advanced filter, I get the row with invoice number 0005962 as expected.

However, if I set my criteria to <>0005962 and apply my advanced filter,
instead of all the rows except that invoice number, I get all rows.

I have tried <>'0005962, <>"0005962", <>"'0005962" - no success.

What has worked is <>0005962*

I have checked the original data and there are no trailing spaces in the
data.

Why does the * work when nothing else does? I'm not keen on using a
wildcard if it is not necessary; is there a way to set my criteria in
this instance without using the wildcard?

Thanks,
Dianne
 
Reply With Quote
 
 
 
 
Gary Keramidas
Guest
Posts: n/a
 
      22nd Aug 2007
have you tried recording a macro while you're doing the filter manually? then
you can look at the code and see what the criteria is.

--


Gary


"Dianne Butterworth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have coded a form for users to do filtering with on data that I pull from an
>SQL Server database. I have a field "Invoice Number" which is a varchar(255)
>column in SQL Server.
>
> I have a criteria range with the column headings in the first row and the
> cells below to fill with the criteria.
>
> Invoice Number often contains numbers with leading zeros, for example 0005962.
> If I set my criteria for Invoice Number to 0005962 and apply my advanced
> filter, I get the row with invoice number 0005962 as expected.
>
> However, if I set my criteria to <>0005962 and apply my advanced filter,
> instead of all the rows except that invoice number, I get all rows.
>
> I have tried <>'0005962, <>"0005962", <>"'0005962" - no success.
>
> What has worked is <>0005962*
>
> I have checked the original data and there are no trailing spaces in the data.
>
> Why does the * work when nothing else does? I'm not keen on using a wildcard
> if it is not necessary; is there a way to set my criteria in this instance
> without using the wildcard?
>
> Thanks,
> Dianne



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Criteria for Advanced Filter HELP knowshowrosegrows Microsoft Excel New Users 5 21st Feb 2009 12:32 PM
Using <> in Advanced Filter criteria Robin Microsoft Excel Discussion 2 12th Nov 2007 03:46 PM
Advanced filter criteria Mark V Microsoft Excel Worksheet Functions 1 13th Jul 2004 10:21 PM
Criteria in Advanced Filter keyur Microsoft Excel Worksheet Functions 2 18th Mar 2004 05:42 PM
Criteria in Advanced Filter Christine Microsoft Excel Misc 2 16th Dec 2003 11:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:22 AM.