473,385 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to Filter Numbers

I have 9 digits in form of "111020402". Then I have another 9 digits
in form of "111020403". I have 100,000 records of these two 9-digit
numbers.
I want to filter this as follows:

District: 111
Charge: 02
Circle: 04
Book Number: 02

For example, if somone asks me to filter 111020402 and 111020403, then
I need to filter in terms of Book Number and tell the person how many
records are there in each 9-digit numbers.

I hope you understand my problem. I am new in advance filtering.

Thanks in advance.
Dec 5 '07 #1
8 3350
"Abedin" <ab*****@gmail.comwrote in message
news:a3**********************************@w56g2000 hsf.googlegroups.com...
>I have 9 digits in form of "111020402". Then I have another 9 digits
in form of "111020403". I have 100,000 records of these two 9-digit
numbers.
I want to filter this as follows:

District: 111
Charge: 02
Circle: 04
Book Number: 02

For example, if somone asks me to filter 111020402 and 111020403, then
I need to filter in terms of Book Number and tell the person how many
records are there in each 9-digit numbers.

I hope you understand my problem. I am new in advance filtering.

Thanks in advance.
You need to normalise your data and store each element of data in its own
field, thus you can query each field as necessary. Your fields:

District
Charge
Circle
BookNumber

can always be concatonated in a query if necessay to form the "big" number:

BigNumber: [District] & [Charge] & [Circle] & [BookNumber]

Keith.
www.keithwilby.com

Dec 5 '07 #2
On Dec 5, 7:04 pm, "Keith Wilby" <h...@there.comwrote:
"Abedin" <abed...@gmail.comwrote in message

news:a3**********************************@w56g2000 hsf.googlegroups.com...


I have 9 digits in form of "111020402". Then I have another 9 digits
in form of "111020403". I have 100,000 records of these two 9-digit
numbers.
I want to filter this as follows:
District: 111
Charge: 02
Circle: 04
Book Number: 02
For example, if somone asks me to filter 111020402 and 111020403, then
I need to filter in terms of Book Number and tell the person how many
records are there in each 9-digit numbers.
I hope you understand my problem. I am new in advance filtering.
Thanks in advance.

You need to normalise your data and store each element of data in its own
field, thus you can query each field as necessary. Your fields:

District
Charge
Circle
BookNumber

can always be concatonated in a query if necessay to form the "big" number:

BigNumber: [District] & [Charge] & [Circle] & [BookNumber]

Keith.www.keithwilby.com- Hide quoted text -

- Show quoted text -
Thanks alot for your help.

Can I break Big Number into small numbers and then later concatenate?
Because I would need to filter it on each individual small numbers.
For example, I might need to filter on District, Charge, Circle, or
Book Number.

Thanks Keith.
Dec 5 '07 #3
On Wed, 5 Dec 2007 06:09:16 -0800 (PST), Abedin <ab*****@gmail.com>
wrote:

There is no need for that. If you follow Keith's advice, you have the
"small numbers" sitting in 4 fields in your table. You only
concatenate for display purposes, not for calculation purposes.

-Tom.

>On Dec 5, 7:04 pm, "Keith Wilby" <h...@there.comwrote:
>"Abedin" <abed...@gmail.comwrote in message

news:a3**********************************@w56g200 0hsf.googlegroups.com...


>I have 9 digits in form of "111020402". Then I have another 9 digits
in form of "111020403". I have 100,000 records of these two 9-digit
numbers.
I want to filter this as follows:
District: 111
Charge: 02
Circle: 04
Book Number: 02
For example, if somone asks me to filter 111020402 and 111020403, then
I need to filter in terms of Book Number and tell the person how many
records are there in each 9-digit numbers.
I hope you understand my problem. I am new in advance filtering.
Thanks in advance.

You need to normalise your data and store each element of data in its own
field, thus you can query each field as necessary. Your fields:

District
Charge
Circle
BookNumber

can always be concatonated in a query if necessay to form the "big" number:

BigNumber: [District] & [Charge] & [Circle] & [BookNumber]

Keith.www.keithwilby.com- Hide quoted text -

- Show quoted text -

Thanks alot for your help.

Can I break Big Number into small numbers and then later concatenate?
Because I would need to filter it on each individual small numbers.
For example, I might need to filter on District, Charge, Circle, or
Book Number.

Thanks Keith.
Dec 5 '07 #4
On Dec 5, 7:14 pm, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
On Wed, 5 Dec 2007 06:09:16 -0800 (PST), Abedin <abed...@gmail.com>
wrote:

There is no need for that. If you follow Keith's advice, you have the
"small numbers" sitting in 4 fields in your table. You only
concatenate for display purposes, not for calculation purposes.

-Tom.
On Dec 5, 7:04 pm, "Keith Wilby" <h...@there.comwrote:
"Abedin" <abed...@gmail.comwrote in message
>news:a3**********************************@w56g200 0hsf.googlegroups.com...
I have 9 digits in form of "111020402". Then I have another 9 digits
in form of "111020403". I have 100,000 records of these two 9-digit
numbers.
I want to filter this as follows:
District: 111
Charge: 02
Circle: 04
Book Number: 02
For example, if somone asks me to filter 111020402 and 111020403, then
I need to filter in terms of Book Number and tell the person how many
records are there in each 9-digit numbers.
I hope you understand my problem. I am new in advance filtering.
Thanks in advance.
You need to normalise your data and store each element of data in its own
field, thus you can query each field as necessary. Your fields:
District
Charge
Circle
BookNumber
can always be concatonated in a query if necessay to form the "big" number:
BigNumber: [District] & [Charge] & [Circle] & [BookNumber]
Keith.www.keithwilby.com-Hide quoted text -
- Show quoted text -
Thanks alot for your help.
Can I break Big Number into small numbers and then later concatenate?
Because I would need to filter it on each individual small numbers.
For example, I might need to filter on District, Charge, Circle, or
Book Number.
Thanks Keith.- Hide quoted text -

- Show quoted text -
Got it. Thank you guys. Love you all.
Dec 5 '07 #5
"Keith Wilby" <he**@there.comwrote in message
news:47**********@glkas0286.greenlnk.net...
"Abedin" <ab*****@gmail.comwrote in message
news:a3**********************************@w56g2000 hsf.googlegroups.com...
>>I have 9 digits in form of "111020402". Then I have another 9 digits
in form of "111020403". I have 100,000 records of these two 9-digit
numbers.
I want to filter this as follows:

District: 111
Charge: 02
Circle: 04
Book Number: 02

For example, if somone asks me to filter 111020402 and 111020403, then
I need to filter in terms of Book Number and tell the person how many
records are there in each 9-digit numbers.

I hope you understand my problem. I am new in advance filtering.

Thanks in advance.

You need to normalise your data and store each element of data in its own
field, thus you can query each field as necessary. Your fields:

District
Charge
Circle
BookNumber

can always be concatonated in a query if necessay to form the "big"
number:

BigNumber: [District] & [Charge] & [Circle] & [BookNumber]

Keith.
www.keithwilby.com
I agree with Keith, however, couldn't you also use a query to separate the
"big" number into a normalized split?

SELECT BigNumber, _
Mid([BigNumber],1,3) AS District, _
Mid([BigNumber],4,2) AS Charge, _
Mid([BigNumber],6,2) AS Circle, _
Mid([BigNumber],8,2) AS Book _
FROM OrigTable;

You could then link this query to OrigTable to create a new query to use.
This preserves your original structure and provides the new flexibility for
easy filtering. It might not be as fast as a re-written table, but might
save you from having to re-write a lot of your application....
Fred Zuckerman

Dec 5 '07 #6
Abedin wrote:
I have 9 digits in form of "111020402". Then I have another 9 digits
in form of "111020403". I have 100,000 records of these two 9-digit
numbers.
I want to filter this as follows:

District: 111
Charge: 02
Circle: 04
Book Number: 02

For example, if somone asks me to filter 111020402 and 111020403, then
I need to filter in terms of Book Number and tell the person how many
records are there in each 9-digit numbers.

I hope you understand my problem. I am new in advance filtering.

Thanks in advance.
If you ever needed to split the 9 digit code, (and the field name is
Code) in the query builder you can do something like
District : Left(Code,3)
Charge : Mid(Code,4,2)
Circle : Mid(Code,6,2)
Book : Mid(Code,8)
This will create columns with those 4 column names. You can then filter
on them individually if you want to.

If you have a form and you need just those with district, charge, and
circle, you could use the word Like
Select * From Table Where _
Code Like '" & Forms!Main!District & _
Forms!Main!Charge
Forms!Main!Circle.
This is basically saying select all records where Code begins with 1110204.

Now, lets say you have a continuous form with a text box named "Search"
for entering your 9 digit code. When you press Enter, the AfterUpdate
event of the field could be
Me.Filter = "Code = '" & Me.Search & "'" 'stored as string
or
Me.Filter = "Code = " & Me.Search 'stored as number
Me.FilterOn = True

There's many ways to go about this. Depends on what you are doing.
Dec 5 '07 #7
On Dec 5, 7:25 pm, Salad <o...@vinegar.comwrote:
Abedin wrote:
I have 9 digits in form of "111020402". Then I have another 9 digits
in form of "111020403". I have 100,000 records of these two 9-digit
numbers.
I want to filter this as follows:
District: 111
Charge: 02
Circle: 04
Book Number: 02
For example, if somone asks me to filter 111020402 and 111020403, then
I need to filter in terms of Book Number and tell the person how many
records are there in each 9-digit numbers.
I hope you understand my problem. I am new in advance filtering.
Thanks in advance.

If you ever needed to split the 9 digit code, (and the field name is
Code) in the query builder you can do something like
District : Left(Code,3)
Charge : Mid(Code,4,2)
Circle : Mid(Code,6,2)
Book : Mid(Code,8)
This will create columns with those 4 column names. You can then filter
on them individually if you want to.

If you have a form and you need just those with district, charge, and
circle, you could use the word Like
Select * From Table Where _
Code Like '" & Forms!Main!District & _
Forms!Main!Charge
Forms!Main!Circle.
This is basically saying select all records where Code begins with 1110204.

Now, lets say you have a continuous form with a text box named "Search"
for entering your 9 digit code. When you press Enter, the AfterUpdate
event of the field could be
Me.Filter = "Code = '" & Me.Search & "'" 'stored as string
or
Me.Filter = "Code = " & Me.Search 'stored as number
Me.FilterOn = True

There's many ways to go about this. Depends on what you are doing.- Hide quoted text -

- Show quoted text -
Wow, this is all useful information. I will definitely use it. Thanks
again y'all.
Dec 5 '07 #8
On Dec 5, 6:45 pm, Abedin <abed...@gmail.comwrote:
I have 9 digits in form of "111020402". Then I have another 9 digits
in form of "111020403". I have 100,000 records of these two 9-digit
numbers.

I want to filter this as follows:

District: 111
Charge: 02
Circle: 04
Book Number: 02

For example, if somone asks me to filter 111020402 and 111020403, then
I need to filter in terms of Book Number and tell the person how many
records are there in each 9-digit numbers.

I hope you understand my problem. I am new in advance filtering.

Thanks in advance.
Hi...

Use substring function of Sql, with starting index and the last index.

Syntx:-select SUBSTR(column_name,String index,length) As Name from
table.

For Ex..
SQLselect SUBSTR(meterserialno,1,3) As CODE, SUBSTR(meterserialno,
4,3) AS NAME from tb_locationmst;

COD NAM
--- ---
RSX 091
RSX 092
RSX 091
RSX 092
RSX 092
RSX 092
RSX 092
RSX 092
RSX 092
RSX 092
RSX 091
Pankaj Singh Yadav
Dec 6 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: TTD | last post by:
Hy, is it possible to filter within a filter on a form? Let's say I have a button which can filter on only open cases and another button to filter on only my cases, then if I pushed both...
2
by: SirPoonga | last post by:
Is it possible that when having a user using Filter By Form in a form that no matter what the user enters in for a value that "LIKE *Value*" gets automatically replaced? Would I have to do...
5
by: Paul de Goede | last post by:
I set the Response.Filter in my aspnet application but I have noticed that if you do a Server.Transfer that the filter doesn't get called. And in actual fact the response is mostly empty. It seems...
5
by: jamesnkk | last post by:
I have a listbox which show customer Names on the 1st column and PO numbers on the 2nd column. When user select the customer and press the OK button, it will access to the PO form. Problem here...
0
by: Josetta | last post by:
This is for informational purposes...I had a problem and I thought it might help others in a similar situation. I hope someone, someday, finds this idea useful. I've garnered so much knowledge...
4
by: bgreer5050 | last post by:
I have a form with various fields with a double click event to bring up a filter via a query. Is it possible to goto another field and apply another filter only to the records that were found...
2
by: emo10001 | last post by:
Hey everyone, New here and fairly new to Access programming. I'm using Access 2003 in XP SP2 I've used this site before without having to ask a question but I'm really stuck :( I have a table...
1
by: Barb.Richards | last post by:
I have created an append query that pulls information from one database, and will append the selected information into a new table. The fields are setup like 'number' 'category' 'code' 'shares' and...
1
by: spyderfusion02 | last post by:
Hey, I'm trying to get my pagination numbers to update when the user uses the filter options at the side. Here is what I'm talking about: When you click the color - Yellow - you should only get 1...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.