how to gain numbers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hiiiiiiii friends
my problem is concern about a querry for example i have numbers in a field
whose data type is number

400004780
400004781
400004782
400004787
400004789
400004710
if it was a text then i can get it with like function such as
like("40000478*")
but how i can get numbers because i can't use like( ) for number
what is the substitute action for that.
 
Actually, Access will probably let you use Like and do an implicit type
conversion on the number.

WHERE YourField\10 = 40000478

Not the use of the \ (Integer division) versus the / in the above
expression.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
You should be able to use Like in the number field.

If it doesn't work for you, in the criteria section of the query you can
convert the number to text in then use Like

Select * From TableName Where CStr([FieldName]) Like "40000478*"
 
hiiiiiiii friends
my problem is concern about a querry for example i have numbers in a field
whose data type is number

400004780
400004781
400004782
400004787
400004789
400004710
if it was a text then i can get it with like function such as
like("40000478*")
but how i can get numbers because i can't use like( ) for number
what is the substitute action for that.

If these "numbers" will not be used for calculation - e.g. if they are
identifiers of some sort - you should really consider using a Text datatype
rather than a Number datatype in your table design. That will prevent
performance problems with datatype conversions to use LIKE, and will make it
possible to expand your field size; note that Long Integers are limited to
values less than 2147483648 so if you go to one digit larger, you're in
trouble!

John W. Vinson [MVP]
 
thanks for the response
dear friends i do know to use Text data type instead of number data type if
i am not using that field for calculation but dear friends i am using the
field for numbers + i need to retrieve the serial of a specific data.
like i have mentioned earlier.
 
thanks for the response
dear friends i do know to use Text data type instead of number data type if
i am not using that field for calculation but dear friends i am using the
field for numbers + i need to retrieve the serial of a specific data.
like i have mentioned earlier.

Open the table in design view.

Select this field.

In the second column of the design grid, next to the name, you can select the
datatype - text, number, date/time, etc. Select Text.

"5" and "9" and "0" are characters as well as being numbers, you can simply
store an eight-character long text string which consists only of numeric
characters. This can be sorted, searched, retrieved, printed - it even is
*better* than a Number field in that you can store leading zeros.

John W. Vinson [MVP]
 
cant' work

John W. Vinson said:
Open the table in design view.

Select this field.

In the second column of the design grid, next to the name, you can select the
datatype - text, number, date/time, etc. Select Text.

"5" and "9" and "0" are characters as well as being numbers, you can simply
store an eight-character long text string which consists only of numeric
characters. This can be sorted, searched, retrieved, printed - it even is
*better* than a Number field in that you can store leading zeros.

John W. Vinson [MVP]
 
cant' work

<shrug>

Then the database that my prime client has had in production for six years
can't have been working all that time. They'll disagree with you.

John W. Vinson [MVP]
 
Back
Top