Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8055853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:31:31+00:00 2026-06-05T08:31:31+00:00

In a table i have stored alot of datetimes for when a certain action

  • 0

In a table i have stored alot of datetimes for when a certain action was taken. The data looks like this:

2012-05-01 14:30:29.8666925
2012-05-01 14:31:58.5422081
2012-05-01 14:35:38.3120864
2012-05-02 06:08:34.6322227
2012-05-02 06:08:54.0864203
2012-05-02 07:31:24.7269620
etc..

What i want to do is count how many times an action was taken per day. So the result i want is:

2012-05-01 = 3
2012-05-02 = 3

I tried to group the dates together, but it also takes the ‘time’ into account when grouping. I do need this data in my database, but not when grouping because i only want to look at it per day. Not per second.

This is what i have so far, but i’m not sure how to get the results i actually want.

var actions = (from a in entities.Actions
group a by a.Date
into g
select new
{
    Actions = g.Count() // Not sure if this line is right...
});

Anyone any idea how to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:31:33+00:00Added an answer on June 5, 2026 at 8:31 am

    Use the EntityFunctions.TruncateTime function, as detailed in this SO post: https://stackoverflow.com/a/9642321/1342632

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to search the computer from this table and when i have stored
I have a stored procedure that updates a table using linq, eg: (this is
I want to (loosely) have a stored procedure like select * from table where
I have a db2 table with certain columns. I have a stored procedure for
I have one table, e.g. pricerules, that have stored special prices by article for
I have a stored procedure which update a table based on such calculation and
I have a stored procedure which accepts a User defined table type called SeasonTable
I have table which contains double values stored in mysql database ...I need to
The entities to be stored have 25+ properties (table columns). The entities are pretty
Okay, so I have this problem with my Fact Table. I need it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.