Retrive the Lattest price from sales price table

Sir please help me

I am new to in navision development …

I want make a report by using sales price table , so I want pick up lattest price of item sales price table

Example

Item No Unit Price Starting Date

FG001 130 01/08/2012

FG001 140 05/08/2012

FG002 100 10/08/2012

FG002 90 15/08/2012

So In report , I want print these vale as

FG001 140 05/08/2012

FG002 90 15/08/2012

Please Help me…

Set filter on Sale prices table where End Date is blank

In sales prices table wherein end date is blank then it is latetest prices,but it should maintain by user that whenever new price entered then user should put end date for previous prices.

Sir I have tried but my field of Ending date in sales price table have blank value for all item

Use FINDLAST for finding the latest price.

Sir when i use FINDLAST then only i get Last value of table so please help me to retrive all Lattest price(Record)

Have you set filter on Item ?

What code you have written ??

Umashankaar- Assuming all the fields are on Sales Price table follow the steps below for your report

dataitem–>sales price

in sales price–>Onpredataitem write

setfilter(“Ending Date”,’%1’,0D);

then keep the fields to be displayed in the sales price–Body section…

Anjan

thank you sir

“Sales Price”.SETRANGE(“Sales Price”.“Item No.”,FORMAT(“Starting Date”));

if “Sales Price”.FINDLAST then repeat

UnitPrice:=“Sales Price”.“Unit Price”;

Until “Sales Price”.NEXT=0;

“Sales Price”.SETRANGE(“Sales Price”.“Item No.”,FORMAT(“Starting Date”));

if “Sales Price”.FINDLAST then repeat

UnitPrice:=“Sales Price”.“Unit Price”;

Until “Sales Price”.NEXT=0;

Hi,

What you have written is correct?

How Item no will be setrange with date ?

What is your dataitem for report ?