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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:18:38+00:00 2026-05-16T17:18:38+00:00

I need a statement to select data from an MS Access database table. WITHIN

  • 0

I need a statement to select data from an MS Access database table.

WITHIN selected dates

I have two textboxes in my GUI called StartDate and EndDate

I want to select data within those 2 dates.

I have tried 2 methods.

The first is

" DAY(V.RegDate) between " + Start.ToString("dd") 
    + " and " + End.ToString("dd");
" and MONTH(V.RegDate) between " + Start.ToString("MM") + " and " 
    + End.ToString("MM");
" and YEAR(V.RegDate) between " + Start.ToString("yyyy") + " and " 
    + End.ToString("yyyy");

V.RegDate is the date column from the database.

But it returns me no data when I select 01/08/2010 and 01/09/2010 while there is some data at 25/08/2010.

I think that is because I chose the date separately and since the 2 dates are the same,
returns me nothing

I have tried another way…

" V.RegDate between #" + Start.ToString("dd/MM/yyyy") + "# and #" _
    + End.ToString("dd/MM/yyyy") + "#";

This also return me nothing

Any Ideas????

  • 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-16T17:18:38+00:00Added an answer on May 16, 2026 at 5:18 pm

    This pattern works for me:

    SELECT sometable.somedate
    FROM sometable
    WHERE (((sometable.somedate) Between #2/1/2010# And #4/1/2010#));
    

    (in this case it’s MDY, I normally prefer ISO-ish style – YYYY/MM/DD because there is no way that Access can screw that up)

    Maybe you’ve got your date set using the American default – MDY instead of the British(?) standard DMY.

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

Sidebar

Related Questions

I need to select data from two table using a join. This is fairly
I need to access the result of a stored procedure within a select statement,
i need to access data from a table and from a view on a
I have two product tables. Table A is the default table (comes from data
I an SQL SELECT statement I need to extract the name of two teams,
I need to merge two SELECT statements. There are two tables in my database,
I am trying to import data from Access to Excel based on two parameters.
I need to extract data from a third party system (I have no influence
I have media_main.php that is obtaining data from a MySQL database. One of the
I need some help with creating an insert statement for an Access 2007 database

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.