DataTable nach Datum Filtern

I have created a DateTable from a SQL query. This contains various names and addresses of course participants. In addition, the DateTime contains the date of the course start. I now want to filter the DateTable so that only entries with a greater or same date as today are visible.

$OpenTable2 = $OpenTable | Where-Object {$_.EventStart -ge [datetime]::today}

However, I always get the error message:
InvalidOperation: Cannot compare “” because it is not IComparable.

From my point of view, both values should be DateTime and not a string. When I look with *getType(), it also shows me DateTime. With other tables I did not have this problem. Is it possibly due to the DataTable object? Does anyone have another idea?

Georg,
Willkommen im PowerShell.org forum.

Dieses Forum ist ein rein englischsprachiges Forum. Wenn Du der englischen Sprache mächtig bist, übersetzt Du Deine Frage einfach und es kann Dir bestimmt geholfen werden. Du kannst aber auch ein deutschsprachiges Forum aufsuchen und Deine Frage dort stellen. Eine ziemlich aktive Gemeinde gibt es z.B. im MCSEboard.de - dort dann im Bereich Scripting.

Danke, ich hatte den Übersetzer aktiv im Browser und gar nicht gemerkt das es eine Englische Seite ist :wink:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.