Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select w/ where clause, returning wrong data

Status
Not open for further replies.

DavidC271

Technical User
Jul 30, 2002
17
US
I am having a problem getting the correct information on the following Select statment.

SELECT * FROM Device_Main WHERE Mail_Code=019-2

It will give me all records where the mail code = 017-6. If I run a query where the Mail_Code=019-1, I get all records for mail_code 018-4. If I run the query on Mail_Code=016-5, I get nothing.

I noticed this first from the output of ASP. I then tried it via the command line. Both gave the exact same results. The mail_codes are in the table and I can see them when I return all records of the table.

I do not think it is the syntax but something with the table. Can anyone offer any suggestions on what could be the problem. Should this field type be text?

If more info is needed, I will be glad to give more.
 
Try changing your query to
[tt]SELECT * FROM Device_Main WHERE Mail_Code='019-2'[/tt] //Daniel
 
You hit the nail on the head. Thanks. Not sure why I did not think of that. Thanks again for the help Daniel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top