0

I'm trying to return a count of records from a database with today's date, using entity framework. I think my query is ok, if you take a look at the screenshot record 2 is the only item out of the 3 with todays date, which is correct.

How can i return a count. Currently its returning a bool value

Thank you

       Dim today = DateTime.Today.Date
       Dim todaysBuild = retrieveOrders.[Select](Function(build) build.TimeAndDate >= today).ToList()

enter image description here

EDIT:

 Dim todaysBuild = retrieveOrders.Where(Function(build) build.TimeAndDate >= today).ToList()
A Houghton
  • 372
  • 5
  • 18

1 Answers1

1

The variable todaysBuild is a list. You need the count (Integer) of that list so add the .Count at the end of your code.

  Dim todaysBuild = retrieveOrders.[WHERE](Function(build) build.TimeAndDate >= today).ToList.Count
alwaysVBNET
  • 3,150
  • 8
  • 32
  • 65