I have to compare datatable date column with todays date.
Initially assigned datenow as Now , here datenow is datatime
in_dt_FilteredCGRecords.AsEnumerable.Where(Function(x) x(“Close Date (Expected Signing or Date Won/Lost/WD)”).ToString < datenow.ToString(“MM/dd/yyyy”)).Count
this condition is not satisfying. can anyone help on this.
For comparing dates you need to convert them. Please use the function as below
in_dt_FilteredCGRecords.AsEnumerable.Where(Function(x) Date.Parse(x(“Close Date (Expected Signing or Date Won/Lost/WD)”).ToString) < datenow).Count
If the format of date is not in standard format in your datatable then try using Date.ParseExact(<DateString(11/04/2022 11:22:22)>,“<Format of date String(MM/dd/yyyy hh:mm:ss)>”,System.Globalization.CultureInfo.InvariantCulture) instead of Date.Parse
This should solve you issue . Please let us know if you need further help
Do Close the Topic by marking the appropriate post as the solution and if your query has been resolved. It would benefit others who are in search for a similar solution.