Hi,
As shown in the image i want the find count of sales order between ( from 7am to 7pm) and I want count for sales order between one hours like (7am-8am) how can be done
Please help in Al code if possible
procedure hrorderpacked()
var
rec_SalesShipmentHeader: Record "Sales Shipment Header";
rec_HourordersPackedByPacker: Record "Hour Order packed";
rec_User: Record User;
curr_Time1: DateTime;
curr_Time2: DateTime;
Diff_Duration: Duration;
begin
if rec_User.FindSet()
then
repeat
rec_SalesShipmentHeader.SetCurrentKey(SystemCreatedAt);
rec_SalesShipmentHeader.SetAscending(SystemCreatedAt, true);
//rec_SalesShipmentHeader.SetRange("Posting Date", Today - 31, Today);
rec_SalesShipmentHeader.SetRange("User ID", rec_User."User Name");
if rec_SalesShipmentHeader.FindSet()
then
repeat
rec_HourordersPackedByPacker.SetRange(Username, rec_User."User Name");
if rec_HourordersPackedByPacker.findSet() then begin
case (rec_SalesShipmentHeader.SystemCreatedAt) of
CurrentDateTime - 3600000 / 7:
rec_HourordersPackedByPacker.Before7AM := rec_HourordersPackedByPacker.Before7AM + 1;
end;
end;
This code is what I tried, please help in this one.
Thankyou.