Hi,
I currently have a table that stores wine names and I want to try to remove the first 4 (+ one whitespace = 5) characters from the products_name field (eg: 1999 Cabernet Sauvignon - remove the 1999 ). The reason for this is that it contains the vintage date and I wish to sort by products_name WITHOUT vintage date being the sort criteria. Thusly, I think that it has to be removed in the sql statement itself. I was thinking of using something similar to LEFT() AS shortened_name or RIGHT() shortened_name but am not sure what the actual statement is. Here is my statement so far:
select $f_db, p.products_id, p.products_name, p.products_model, m.manufacturers_name, m.manufacturers_location, p.products_price where p.products_status = '1' and $f_db = '" . $sort ."' and p.products_id = p2m.products_id and p2m.manufacturers_id = m.manufacturers_id
and p.products_id = p2c.products_id and p2c.categories_id = " . $current_category_id . " order by $vert_order
Thanks,
Jacob