How to find out highest and lowest value with a date and send a mail

Hi, I am trying to go through a CSV file that I got from Yahoo Finance for a Company > historical data > download ( I did all this through a web recording using clicks and type into and then saved the CSV file.

  1. How to find out hightest value with a particular date (Column 1: Date , Column 2: High)
  2. How to find out lowest value with a particular date (Column 1: Date , Column 3: Low )
  3. Send a mail

My CSV Data Looks like below mentioned table:

image

  • Load data into a datatable
  • Filter the DT for the given date
  • Add min and max values from the filtered DT to 2 lists of type Double
  • Find min from one list and max from the other.

https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.max?view=net-8.0

Hi @Kruthi_BS

Try this

Maximum date = Dt_yourdatatable.AsEnumerable().Max(Function (r) DateTime.Parse(r.Item("YourColumnName").ToString))

Minimum date = Dt_yourdatatable.AsEnumerable().Min(Function (r) DateTime.Parse(r.Item("YourColumnName").ToString))

Maximum value = dt.AsEnumerable().Max(Function(row) Convert.ToDouble(row("YourColumnName")))

Minimum Value = dt.AsEnumerable().Min(Function(row) Convert.ToDouble(row("YourColumnName")))

Regards,
Gowtham K

can you tell me is there any way show in two syntax for minimum value with a corresponding date and maximum value with a corresponding date . Instead of writing 4 times syntax?

Is this question different to the other thread?