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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:49:02+00:00 2026-05-17T01:49:02+00:00

I have a timestamp field [SubmissionDate], which defaults to current_timestamp, and i was wondering

  • 0

I have a timestamp field [SubmissionDate], which defaults to current_timestamp, and i was wondering how do i query my database in such a fashion that for example i get only shown all entries submitted on a certain year and month?
Something like:

SELECT * FROM DNA_entrys
WHERE `SubmissionDate`.month = February
AND `SubmissionDate`.year = 2004

Should be an elementary operation but i couldn’t find a quick answer on that

  • 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-17T01:49:03+00:00Added an answer on May 17, 2026 at 1:49 am
    SELECT * FROM DNA_entrys
    WHERE month(`SubmissionDate`) = 2
    AND year(`SubmissionDate`) = 2004
    

    tho i suggest:

    SELECT * FROM DNA_entrys
    WHERE `SubmissionDate` between '2004-02-01' and ('2004-03-01' - INTERVAL 1 SECOND)
    

    latter allows use of indexes, which makes query faster if you have ithat field indexed.

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

Sidebar

Related Questions

I have a Timestamp field in a WebSQL database that is stored like: /Date(1340420400000)/
I have a MySQL database table, with a unix timestamp field. I am wondering
A have a JPA entity that has timestamp field and is distinguished by a
I have a field timestamp in my table,which is of type long I want
What I have: I have a timestamp field with the time that my project
I have a table with a timestamp field onto which I've created a composite
I have the following function but have a problem in that my timestamp field
I have a products table with a stock field and a timestamp field that
I have a timestamp field (using the timestampable template) that I want formatted differently
I have Informix database with timestamp field defined as YEAR TO SECOND. When 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.