Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL help

Author  Topic 

jrockfl
Posting Yak Master

223 Posts

Posted - 2004-11-18 : 09:47:45
I'm working on this query and I need help with AND D.Filler_0001 = '01 98165'
A.item = 98165 But D.Filler = 01 98165

How can I make D.Filler = A.item

SELECT A.item_no, A.prod_cat, B.prc_or_disc_1, B.prc_or_disc_2, B.prc_or_disc_3, C.std_cost, D.prc_or_disc_1 AS DealerPrice
FROM IMITMIDX_SQL A,
(SELECT prc_or_disc_1, prc_or_disc_2, prc_or_disc_3, Filler_0001
FROM OEPRCFIL_SQL) B,
(SELECT std_cost, prod_cat, loc
FROM IMINVLOC_SQL) C,
(SELECT prc_or_disc_1, Filler_0001, Cd_Tp
FROM OEPRCFIL_SQL) D
WHERE B.Filler_0001 LIKE A.prod_cat + '%'
AND A.prod_cat = 'R34'
AND A.prod_cat = C.prod_cat
AND C.Loc = 'TP'
AND D.Filler_0001 = '01 98165'

X002548
Not Just a Number

15586 Posts

Posted - 2004-11-18 : 10:19:41
Do you mean like


DECLARE @Filler varchar(50)

SELECT @Filler = '01 98165'

SELECT SUBSTRING(@Filler,4,LEN(@Filler)-3)





Brett

8-)
Go to Top of Page

jrockfl
Posting Yak Master

223 Posts

Posted - 2004-11-18 : 11:05:03
I mean something like....
AND A.prod_cat = SUBSTRING(D.Filler_0001,4,LEN(D.Filler_0001)-3)

98165 = 98165

but that doesnt work..
Go to Top of Page
   

- Advertisement -