Get the dates out of an datefilter

With help from Codeunit 1 I have stored a datefilter in a variabel (it is not a variabel in a table!). Is there any easy way to get the starting- and stopping dates out of the filter? I.e if the filter looks like 12.12.03…12.12.04 I want 2 new variables Date1 and Date2 containing: Date1 = 12.12.03 Date2 = 12.12.04 I guess COPYSTR would work…

Hi Jensthomsen, Pls see the build in function call “GETRANGEMAX” and “GETRANGEMIN”.

I have coded it like this, gvDateFilter := xxx.GETFILTER(Date); gvFilterFrom := COPYSTR(gvDateFilter, 1, 8); gvFilterTo := COPYSTR(gvDateFilter, 11, 8); EVALUATE(gvDateFrom, gvFilterFrom); EVALUATE(gvDateTo, gvFilterTo); gvFilterFrom and gvFilterTo are datatype TEXT gvDateFrom and gvDateTo are datatype DATE Hope this helps. Fred

Hi Chee As far as I understand these 2 only works on fields in a record, and my “problem” is, that my Datefilter is stored in a Global Variabel!

Hi Jens, The GETRANGEMIN and GETRANGEMAX will do the trick. With a litle work-around. e.g. Define a record-variable: RecVar - record - G/L Account RecVar.SETFILTER(“Date Filter”,YourVariable); IF RecVar.GETRANGEMIN(“Date Filter”) <> ‘’ THEN Date1 := RecVar.GETRANGEMIN(“Date Filter”); IF RecVar.GETRANGEMAX(“DateFilter”) <> ‘’ THEN Date2 := RecVar.GETRANGEMAX(“Date Filter”); regards, Alexander