This content has been marked as final. Show 6 replies
I have one urgent requirement. Requirement is that if Rate of Transport from 6-7-13 to 13-7-13 is 895 and from 1-7-13 to 5-7-13 is 855.Then I need Previous Rate which is 855. How i find ??
My code is below:
FROMDELIVERYPOINTCODE&TODELIVERYPOINTCODE&VEHICLETYPE&Upper(DLVMODEID) as KEY,
if(ALE_FREIGHTTYPE=0,'Primary','Secondary') as ALE_FREIGHTTYPE,
date(EFFECTIVEDATETIME) AS StartDate
(qvd)Where DATAAREAID=100 and YEAR(EFFECTIVEDATETIME)<>1900;
Date(if(Previous(KEY) = KEY,date(previous(StartDate)-1),date(Today()))) as EndDate,
if(KEY=Previous(KEY),Previous(RATE)) as [Previous RATE]
Resident Freight //Where num(StartDate)<=Date(if(Previous(KEY) = KEY,date(previous(StartDate)-1),date(Today())))
Order By KEY,StartDate Desc;
Please help me out !!
Thanks in advance ..