Yes, i want to filter on a date collumn in a listview. But the date collumn can have more date format.
monoceres: I know what you mean.
Is this an idea?
Func _FormatDate($Date,$Sep = "/")
$Now = _NowDate()
$Now = StringReplace($Now,".",$Sep)
$Now = StringReplace($Now,"\",$Sep)
$Now = StringReplace($Now,"-",$Sep)
$Now = StringReplace($Now," ",$Sep)
$Part = StringSplit($Now,$Sep)
$Date = StringReplace($Date,".",$Sep)
$Date = StringReplace($Date,"\",$Sep)
$Date = StringReplace($Date,"-",$Sep)
$Date = StringReplace($Date," ",$Sep)
$Part2 = StringSplit($Date,$Sep)
$Part[1] = INT($Part[1])
$Part[2] = INT($Part[2])
$Part[3] = INT($Part[3])
Switch True
Case $Part[1] = Int(@YEAR) AND $Part[2] = Int(@MON) AND $Part[3] = Int(@MDAY) ; Y M D
Return _AddZero($Part2[1]) & $Sep & $Part2[2] & $Sep & $Part2[3]
Case $Part[1] = Int(@YEAR) AND $Part[3] = Int(@MON) AND $Part[2] = Int(@MDAY) ; Y D M
Return _AddZero($Part2[1]) & $Sep & $Part2[3] & $Sep & $Part2[2]
Case $Part[3] = Int(@YEAR) AND $Part[2] = Int(@MON) AND $Part[1] = Int(@MDAY) ; D M Y
Return _AddZero($Part2[3]) & $Sep & $Part2[2] & $Sep & $Part2[1]
Case $Part[3] = Int(@YEAR) AND $Part[1] = Int(@MON) AND $Part[2] = Int(@MDAY) ; M D Y
Return _AddZero($Part2[3]) & $Sep & $Part2[1] & $Sep & $Part2[2]
Case Else
MsgBox(48,$AppName,"Date cannot be formatted correctly.")
Return ""
EndSwitch
EndFunc