Hi there,
I have data as follows:
ID Name Track_type
578-1 Sugar Kitchen - Sugar001
578-1 Salt Snow - Salt002
57869-1 Vitamin A Health - Vit001
57869-2 Vitamin C Health - Cal001
5786900-1 Tea Tree - Tea001
5786900-2 Coffee Tree - Coffee002
488043-1 Yogurt Kids - Yog005
Now i just need to display records based on the ID numbers before '-'
so if the user want to see what is under ID 578 it should only display:
578-1 Sugar Kitchen - Sugar001
578-1 Salt Snow - Salt002
or Under 57869 it should show only the following:
57869-1 Vitamin A Health - Vit001
57869-2 Vitamin C Health - Cal001
or Under 5786900 it should show only the following:
5786900-1 Tea Tree - Tea001
5786900-2 Coffee Tree - Coffee002
The Sql Statement that I have is as following:
@UserChoice varchar(10)
select ID, Name, Track_type
from Ingredients
where (left (ID, 5) = left (@UserChoice, 5))
this one shows the following:
57869-1 Vitamin A Health - Vit001
57869-2 Vitamin C Health - Cal001
5786900-1 Tea Tree - Tea001
5786900-2 Coffee Tree - Coffee002
how to modify this query to accomodate above results...
Any help is appreciated....
I have data as follows:
ID Name Track_type
578-1 Sugar Kitchen - Sugar001
578-1 Salt Snow - Salt002
57869-1 Vitamin A Health - Vit001
57869-2 Vitamin C Health - Cal001
5786900-1 Tea Tree - Tea001
5786900-2 Coffee Tree - Coffee002
488043-1 Yogurt Kids - Yog005
Now i just need to display records based on the ID numbers before '-'
so if the user want to see what is under ID 578 it should only display:
578-1 Sugar Kitchen - Sugar001
578-1 Salt Snow - Salt002
or Under 57869 it should show only the following:
57869-1 Vitamin A Health - Vit001
57869-2 Vitamin C Health - Cal001
or Under 5786900 it should show only the following:
5786900-1 Tea Tree - Tea001
5786900-2 Coffee Tree - Coffee002
The Sql Statement that I have is as following:
@UserChoice varchar(10)
select ID, Name, Track_type
from Ingredients
where (left (ID, 5) = left (@UserChoice, 5))
this one shows the following:
57869-1 Vitamin A Health - Vit001
57869-2 Vitamin C Health - Cal001
5786900-1 Tea Tree - Tea001
5786900-2 Coffee Tree - Coffee002
how to modify this query to accomodate above results...
Any help is appreciated....