Need some help filtering dates.

Curtis2009
Member Posts: 13
Hi all, im newbie to navision and im facing some problems in this situation. What i need to do is to distribute a resource and check for the dates where the resource is already allocated. For example,i have the date ranges
Resource 1 10-02-09 to 20-02-09 20%
Resource 1 03-02-09 to 12-02-09 20%
Resource 1 15-02-09 to 22-02-09 20%
Resource 1 01-02-09 to 21-02-09 20%
Resource 1 11-02-09 to 12-02-09 20%
it should be 5 interceptions, and the SUM of the allocations cant exceed 100%, so i need to check for interceptions when the user modifies the allocation %.
](*,) ](*,) ](*,) , cant find a solution for this, so any help will be gadly aprecciated.
Greetings
Resource 1 10-02-09 to 20-02-09 20%
Resource 1 03-02-09 to 12-02-09 20%
Resource 1 15-02-09 to 22-02-09 20%
Resource 1 01-02-09 to 21-02-09 20%
Resource 1 11-02-09 to 12-02-09 20%
it should be 5 interceptions, and the SUM of the allocations cant exceed 100%, so i need to check for interceptions when the user modifies the allocation %.
](*,) ](*,) ](*,) , cant find a solution for this, so any help will be gadly aprecciated.
Greetings
0
Comments
-
By interceptions you mean that a date is included in more than one filter then one solution would be:
Declare to variables of type Rec -> Date
Set one of the as temporary.
DateRec
tmpDateRec
then do:
tmpDateRec.DELETEALL;
DateRec.SETRANGE("Period Type",DateRec."Period Type"::Date);
DateRec.SETRANGE("Period Start",DateValue1,DateValue2);
IF DateRec.FIND('-') THEN REPEAT
tmpDateRec := DateRec;
tmpDateRec.INSERT;
UNTIL DateRec.NEXT = 0;
If a date is included more times your insert will cause an error.
If you want to hadle the error then you can do :
IF NOT tmpDate.INSERT THEN BEGIN
Handle error here.
END;
You could also do it with MARK and no temporary records.
It's about the way you want to approach it. There are many ways...
Hope this helps you.0 -
Thanks a lot kapamarou, that was it \:D/0
-
Glad to help out.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions