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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:13:12+00:00 2026-06-01T21:13:12+00:00

I am having 2 issues with fetching data from doctrine: Select records from start

  • 0

I am having 2 issues with fetching data from doctrine:

  1. Select records from start of month to current date
  2. Select records from start of year to current date

How can I write a Doctrine queries to do the same thing as we do in Mysql

Here is my incomplete code from my repository?

public function findByYearlyAttendanceTillToday($id)
{
    $em = $this->getEntityManager();
    $query = $em->createQuery("SELECT count(a) FROM CollegeStudentBundle:StudentAttendance a where a.present LIKE 'A' and a.student_id = :id and a.date > :date");
    $query->setParameter('id', $id);
    $query->setParameter('date', **?????**);
    return $query->getResult();
}
  • 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-01T21:13:14+00:00Added an answer on June 1, 2026 at 9:13 pm

    Here is what you need:

    new \DateTime('midnight first day of this month');
    new \DateTime('first day of january');
    

    I would also change this:

    a.date > :date
    

    to this:

    a.date >= :date
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a weird issue - in my code I am fetching data from
Having issues referencing $(this) from within a the nested ajax 'success' function... I know
Still having issues with this problem. Please help if you can. So I am
Having issues calling the ReportingService2005.FindItems() method from within powershell v2. $rs = New-WebServiceProxy -Uri
having issues getting a value from a NSString in my view controller to my
Having issues with dynamically creating <select> tags and then populating them with XML values.
Having issues removing index.php? from the URL: http://localhost/index.php?/reset_password With htaccess file: # Customized error
Having issues trying to select html injected into the DOM using jquery's load. Works
Having issues getting django custom commands to work. From django documetation , have placed
Having issues attaching a Database and full text catalog from server A to server

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.