Quantcast
Viewing all articles
Browse latest Browse all 32065

Get the Total Count of TimeStamp in LINQ

in SQL, I am able to get the total count of different timestamp of its date as shown below.
Image may be NSFW.
Clik here to view.


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


Viewing all articles
Browse latest Browse all 32065

Trending Articles