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 7962877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:28:03+00:00 2026-06-04T05:28:03+00:00

I have a DateTime type column named CreatedDate in my sql table, and am

  • 0

I have a DateTime type column named “CreatedDate” in my sql table, and am passing the value for this column by using “DateTime.Now” from my asp.net application….

The datas in my CreatedDate column are,

 CreatedDate
 -----------
 2012-05-07 18:56:17.487
 2012-05-07 18:56:28.443
 2012-05-07 19:21:24.497
 2012-05-14 15:22:04.587

I need to get the datas with this CreatedDate.

in my entity framework I tried the condition like

DataAccess.Entities dataEntities = new DataAccess.Entities();

DataAccess.Employee employee = dataEntities.Employees
                              .First(e => e.CreatedDate == DateTime.Today);

like this, I have data for this date(2012-05-14) , but the mininutes part differes (the DateTime.Today gives '2012-05-14 12:00:000' like this) here, and it shows error like, sequence contains no element….

How can I compare the ‘Date’ alone in Linq…..can anyone help me here,,,

  • 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-04T05:28:04+00:00Added an answer on June 4, 2026 at 5:28 am

    I just declared two variable like

    DateTime date1=DateTime.Now.Date;
    DateTime date2=DateTime.Now.Date.AddDays(1);
    

    and in the condition I used these variables like

    DataAccess.Employee employee = dataEntities.Employees
                              .First(e => e.CreatedDate >= date1 
                                       && e.CreatedDate < date2);
    

    its working….

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

Sidebar

Related Questions

In mysql database i have this column called: Name: Date Type: datetime I have
I have a table abc with a field datetime_abc type-> DATETIME in mysql. and
I have some XML that stores column information and row data from a table
I have a column named Lastmodified , with a data type of Date ,
I have daily scheduled task that queries a table which includes column named AttemptDate
For an existing table in SQL compact 4 db Added a column of Type
I have a list of Foo's . Foo has a CreateDate of type DateTime?
Dynamic Data question: I have 2 fields of type Nullable<DateTime> on my model When
I have a datetime column in db that I want to transform into a
I have a DateTime field in SQL Server for some products expiration (ExpirationDate). I

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.