
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
Iftikar HussainPosted Aug 20, 2013, 3:20 AM
p.TESTFLAG == 1
Regards,
Iftikar
TAN WhoAMIPosted Aug 29, 2013, 11:33 PM
Iftikar HussainPosted Aug 22, 2013, 5:04 AM
Regards,
Iftikar
TAN WhoAMIPosted Aug 22, 2013, 4:25 AM
Iftikar HussainPosted Aug 22, 2013, 2:42 AM
if it does not work then share your screen
Regards,
Iftikar
TAN WhoAMIPosted Aug 22, 2013, 2:40 AM
where p.MONO == Mono && p.ITNO == PartNo && p.SYSTEMTYPE == "0036" && p.TESTFLAG == 1
orderby p.TIMESTAMP
select p.TIMESTAMP).Distinct(); // all timestamp MO
Iftikar HussainPosted Aug 22, 2013, 2:26 AM
Regards,
Iftikar
TAN WhoAMIPosted Aug 22, 2013, 2:11 AM
Iftikar HussainPosted Aug 22, 2013, 1:52 AM
Regards,
Iftikar
TAN WhoAMIPosted Aug 22, 2013, 1:42 AM
but in LINQPAD, it is sorted in the ascending order which I want?
Iftikar HussainPosted Aug 21, 2013, 2:35 AM
TAN WhoAMIPosted Aug 21, 2013, 2:32 AM
Iftikar HussainPosted Aug 21, 2013, 2:26 AM
TAN WhoAMIPosted Aug 21, 2013, 2:23 AM
Iftikar HussainPosted Aug 21, 2013, 1:58 AM
TAN WhoAMIPosted Aug 21, 2013, 1:57 AM
it would have this error:
base {System.SystemException} = {"LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression."}
Iftikar HussainPosted Aug 21, 2013, 1:38 AM
IEnumerable
TAN WhoAMIPosted Aug 21, 2013, 1:25 AM
Can I check how can I extract out those 4 dates of type string from TotalDays?
Also, how can I extract out those 4 values (177, 120, 204, 1) of type int from TotalDays?
thanks.
TAN WhoAMIPosted Aug 20, 2013, 7:20 PM
Iftikar HussainPosted Aug 20, 2013, 2:47 AM
Regards,
Iftikar
TAN WhoAMIPosted Aug 20, 2013, 2:35 AM
Iftikar HussainPosted Aug 20, 2013, 1:04 AM
Regards,
Iftikar
TAN WhoAMIPosted Aug 19, 2013, 8:20 PM
Iftikar HussainPosted Aug 19, 2013, 5:06 AM
Regards,
Iftikar
TAN WhoAMIPosted Aug 19, 2013, 4:48 AM
Iftikar HussainPosted Aug 19, 2013, 4:44 AM
p.TESTFLAG == 1
TAN WhoAMIPosted Aug 19, 2013, 4:27 AM
Iftikar HussainPosted Aug 19, 2013, 4:16 AM
Regards,
Iftikar
TAN WhoAMIPosted Aug 19, 2013, 3:44 AM
your above gives this output which is useful for me.
I would need my C# program to get the value of 3 too.
Iftikar HussainPosted Aug 19, 2013, 3:24 AM
Regards,
Iftikar
TAN WhoAMIPosted Aug 19, 2013, 3:21 AM
even with say
it displays all those 3 different dates...
What I want to do is to get the value of 3 in C# LINQ.
Iftikar HussainPosted Aug 19, 2013, 2:52 AM
Regards,
Iftikar
TAN WhoAMIPosted Aug 19, 2013, 2:36 AM
Iftikar HussainPosted Aug 19, 2013, 2:32 AM
TAN WhoAMIPosted Aug 19, 2013, 2:23 AM
Iftikar HussainPosted Aug 19, 2013, 2:01 AM
p.TIMESTAMP.ToString("MM/dd/yyyy")
Regards,
Iftikar
TAN WhoAMIPosted Aug 19, 2013, 1:41 AM
as seen below:
the problem is C# does not recognize the word Truncate. Do we need to add any reference?
Iftikar HussainPosted Aug 19, 2013, 1:27 AM
Regards,
Iftikar
TAN WhoAMIPosted Aug 19, 2013, 1:19 AM
above does not work.
Iftikar HussainPosted Aug 19, 2013, 12:46 AM
In linq use Truncate(p.TIMESTAMP)
Regards,
Iftikar