Click to See Complete Forum and Search --> : Search an Access Database


December 27th, 1999, 12:53 PM
How can I search a field in an Access database for a number and display that record?

valkyrie
December 27th, 1999, 08:52 PM
Guess you have to use a SQL Query.
For example, you have a field which stores numbers in a table in an Access database.
Table = sales
Field = invoice_num

So, you would like to search for a particular invoice number like '123', so you build a SQL string like this

SELECT invoice_num
FROM sales
WHERE invoice_num = 123


The WHERE clause of the SQL query would give you the condition as to what number you want to look for, unless you are looking for a pattern in a field, then, that is another story.

Hope this helps...

____________________________________
The VB Bugs in my Life...

Sudharshaan
December 28th, 1999, 03:40 AM
u can use a Select query as

str="Select * from table name where field =123 "

in sql server user
str=Select * from dsn.dbo.table name where field =123

Sudharshaan