TAN WhoAMI

TAN WhoAMI

  • NA
  • 291
  • 0

Get the Total Count of TimeStamp in LINQ

Aug 18 2013 10:46 PM
in SQL, I am able to get the total count of different timestamp of its date as shown below.


the data is also attached. How do I have it in C# LINQ?

I try below, it does not return value of 3, but total number of different times. I need to have the word trunc in LINQ. thanks.

 int TotalDays = (from p in context.PPL_PRODUCT_TESTID2
                             where p.MONO == Mono && p.ITNO == PartNo && p.SYSTEMTYPE == "0036" && p.TESTFLAG == 1
                             select p.TIMESTAMP).Distinct().Count();  // all timestamp MO


Attachment: example.rar

Answers (40)