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

  • SEARCH
  • Home
  • 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 212959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:14:04+00:00 2026-05-11T18:14:04+00:00

I have read this question but it’s not quite what I was looking for.

  • 0

I have read this question but it’s not quite what I was looking for.
My problem is I whant to do this:

SELECT CONVERT(varchar(10), m.CreateDate, 103) as [Date] , count(*) as [Count] FROM MEMBERS as m
WHERE m.CreateDate >= '24/01/2008' and m.CreateDate <= '26/06/2009' 
Group by CONVERT(varchar(10), m.CreateDate, 103)

result is:

 Date     Count 

 02/03/2009 4  
 24/02/2009 3   
 25/02/2009 3  
 26/02/2009 3

and I’m doing this:

From m In Me.Members _
Where m.CreateDate >= "22/02/2008" And m.CreateDate <= "22/05/2009" _
Group m By m.CreateDate Into g = Group _
Select New With {CreateDate, .Count = g.Count()}

that acoording to LINQPad does this in SQL:

SELECT COUNT(*) AS [Count], [t0].[CreateDate]
FROM [Members] AS [t0]
WHERE ([t0].[CreateDate] >= @p0) AND ([t0].[CreateDate] <= @p1)
GROUP BY [t0].[CreateDate]

and the result is:

      Date          Count
24/02/2009 00:00:00  1
24/02/2009 07:07:10  1
24/02/2009 12:24:10  1
25/02/2009 03:43:05  1 
25/02/2009 03:48:36  1 
25/02/2009 04:25:11  1 
26/02/2009 01:51:24  1 
26/02/2009 09:54:55  1 
26/02/2009 09:55:31  1 
02/03/2009 05:29:22  1 
02/03/2009 05:45:50  1 
02/03/2009 06:15:31  1 
02/03/2009 06:59:07  1

So I understant that the diference is the CONVERT part. So How can I convert from Date or Datetime to SmallDate or something like that in LINQ ?

Thanks

  • 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-05-11T18:14:05+00:00Added an answer on May 11, 2026 at 6:14 pm

    Try this:

    From m In Me.Members _
    Where m.CreateDate.Date >= new DateTime( 2009, 2, 22 ) And m.CreateDate.Date <= new DateTime( 2009, 5, 22) _
    Group m By day = m.CreateDate.Date Into g = Group _
    Select New With { .Date = day.ToString( "dd/MM/yyyy" ), .Count = g.Count()}
    

    If CreateDate is nullable, then you’ll need to use the Value parameter before extracting the Date. You may also be able to omit the extraction of the Date on the WHERE query depending on the sense of the end date check (is it inclusive, then use Date, else omit Date).

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

Sidebar

Related Questions

I have read this question and the simple and clear answer but it's not
I just read this question I have same problem too, but I wanted more.
I was reading this question (which you do not have to read because I
I have read through this SO question about 32-bits, but what about 64-bit numbers?
I have read this question , but I couldn't create a full example: class
Apologies, but I have searched and read previous answers on this question but couldn't
I have read this question and I am having the same problem: Put text
i've read several thread for this question but unfortunatly not found the answer to
I have read this question but it doesn't exactly answer my question. Unfortunately, it
I have read this question . I have same issue, but I don't understand

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.