I want to enter a date range like 010114..093014 & after that i want to pick 1st date from date range. How can it be possible? Plz Suggest.
Thanks
*This post is locked for comments
I want to enter a date range like 010114..093014 & after that i want to pick 1st date from date range. How can it be possible? Plz Suggest.
Thanks
*This post is locked for comments
Hi Siddhartha,
GETRANGEMIN can help you. I use Posting Date of Sales Header as Jonathan in below example, but you can use any record that has a Date field:
lRec_SalesHeader.SETFILTER("Posting Date", '010114..093014');
MESSAGE('%1', lRec_SalesHeader.GETRANGEMIN("Posting Date"));
// variables: dateFilterString,convString,strDate1,strDate2 of type Text
dateFilterString := '010114..093014';
convString := CONVERTSTR(dateFilterString,'..',',');
strDate1 := SELECTSTR(1,convString);
strDate1 := SELECTSTR(2,convString);
// variables: date1,date2 of type Date
EVALUATE(date1, strDate1);
EVALUATE(date2, strDate2);
salesHeader.SETRANGE(salesHeader."Posting Date",date1,date2);
Actually it is separate text type variable like account schedule report date filter. i need to split that date range.
hi
salesHeader.SETRANGE(salesHeader."Posting Date",010114D,093014D);
IF salesHeader.FINDFIRST THEN
MESSAGE(FORMAT(salesHeader."Posting Date"));
Hi,
First use Table.SETCURRENTKEY with Key field like posting date. (date field should be the first field in your key)
User the setfilter with %1..%2
after above do Findfirst and go with the record.
If you look at any other information then please provide more details so we can suggest.
Small Example:
BankAccLedgEntry.RESET;
BankAccLedgEntry.SETCURRENTKEY("Bank Account No.","Global Dimension 1 Code",
"Global Dimension 2 Code","Posting Date","Location Code");
BankAccLedgEntry.SETRANGE("Bank Account No.","No.");
BankAccLedgEntry.SETFILTER("Posting Date",'%1..%2',0D,NORMALDATE(GETRANGEMIN("Date Filter")) - 1);
IF FINDFIRST THEN
Regards,
Saurabh Shah
André Arnaud de Cal... 291,711 Super User 2024 Season 2
Martin Dráb 230,458 Most Valuable Professional
nmaenpaa 101,156