Newbie Needs Help!
I am in need of assistance.
Summary: I have a database with part numbers. Some part numbers contain hyphens. I want to be able to enter a part number without hyphens to be able to search for part numbers with hyphens.
Example: A user enters 4000. I would like for the user to be able to get the results for 4000, 40-00, 40-0-0, etc.
I can't seem to come up with solid enough syntax to process this. Some users may even enter up to 10 digits worth of a part number.
The following appears to work on a database of small size, but I have a huge database. Also, I have some WHERE statements I would like to include. Can WHERE statements be used with HAVING?
SELECT standard_inventory.inv_id, standard_inventory.inv_partnum, REPLACE(standard_inventory.inv_partnum, '-', '') AS temp, standard_inventory.inv_compid, standard_inventory.inv_condition, standard_inventory.inv_price, standard_inventory.inv_quantity, standard_inventory.inv_manuf, standard_inventory.inv_insert_date, standard_inventory.inv_desc, standard_inventory.inv_wts, company.comp_id, company.comp_flag
FROM
standard_inventory, company
HAVING
temp LIKE '$partnum%'