cancel
Showing results for 
Search instead for 
Did you mean: 

purchase price different

Former Member
0 Kudos

Hallow good afternoon all the experts

I have made this query and can work in the branch office A, and my copy at the office of the branch B why can not work?

His description is No data was found as a result of the selection criteria.

if anyone can help me fix my Query

This is my Query

SELECT T1.[DocEntry], T0.[CardCode], T0.[CardName], T0.[DocDate], T1.[ItemCode], T1.[Dscription], T1.[Price], T2.[LastPurPrc]T1.[NumPerMsr] AS 'Last Purchase Price', (T1.[Price] - (T2.[LastPurPrc]T1.[NumPerMsr])) AS 'Variance', (((T1.[Price] - (T2.[LastPurPrc]T1.[NumPerMsr]))/(T2.[LastPurPrc]T1.[NumPerMsr]))*100) AS 'Variance%', T3.[SlpName]

FROM OPDN T0 INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode WHERE (T2.[LastPurPrc] > 0) AND Month(T0.[DocDate]) = Month(Getdate()) AND Year(T0.[Docdate]) = Year(Getdate()) AND (((T1.[PriceBefDi] - (T2.[LastPurPrc]T1.[NumPerMsr]))/(T2.[LastPurPrc]T1.[NumPerMsr]))*100) > 5

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The query itself has no problem. You may omit condition one by one to see which one cause no record.

Thanks,

Gordon

Former Member
0 Kudos

good afternoon expert

Gurdon Hi, thanks for answering my questions and I've found where the error, and could work. I have made the settings automatically 5% how to make that the user can input a desired selection criteria

this my Query

SELECT T1.[DocEntry], T0.[CardCode], T0.[CardName], T0.[DocDate], T1.[ItemCode], T1.[Dscription], T1.[Price], T2.[LastPurPrc]T1.[NumPerMsr] AS 'Last Purchase Price', (T1.[Price] - (T2.[LastPurPrc]T1.[NumPerMsr])) AS 'Variance', (((T1.[Price] - (T2.[LastPurPrc]T1.[NumPerMsr]))/(T2.[LastPurPrc]T1.[NumPerMsr]))*100) AS 'Variance%', T3.[SlpName] FROM OPCH T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode WHERE (T2.[LastPurPrc] > 0) AND Month(T0.[DocDate]) = Month(Getdate()) AND Year(T0.[Docdate]) = Year(Getdate()) AND

((((T1.[PriceBefDi] - (T2.[LastPurPrc]T1.[NumPerMsr]))/(T2.[LastPurPrc]T1.[NumPerMsr]))*100) between >= [0%] and <=[1%] )

Thanks

Former Member
0 Kudos

Hai Good Morning all Expert

the theard is close

Thx