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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:40:44+00:00 2026-06-17T17:40:44+00:00

I am trying tomake a select join between two specific dates in the database

  • 0

I am trying tomake a select join between two specific dates in the database

This I feelis on the right path but is incorrect

How can I get this to work

SELECT --RTRIM(C.CustomerFirstName) + ' ' + LTRIM(C.CustomerLastName) as CustomerFullName,
       ROW_NUMBER() OVER(ORDER BY CP.ActionDate) AS RowNumber,
       C.CustomerFirstName,
       C.CustomerLastName,
       C.CustomerCompany,
       C.CustomerPosition,
       C.CustomerCountry,
       C.CustomerProvince,
       C.CustomerContact,
       CP.ActionDate,
       CP.ProductCode,
       CP.CustomerEmail
FROM   tblCustomers C
       JOIN tblCustomerProducts CP
            ON  C.CustomerEmail = CP.CustomerEmail


     ORDER BY ActionDate DESC
WHERE CP.ActionDate BETWEEN '1/17/2013' AND '19/12/2012'
  • 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-17T17:40:45+00:00Added an answer on June 17, 2026 at 5:40 pm

    Instead of

    WHERE CP.ActionDate BETWEEN '1/17/2013' AND '19/12/2012`
    

    Try this:

    WHERE CP.ActionDate BETWEEN '19/12/2012' AND '1/17/2013'
    

    Note that: This is because the BETWEEN predicate in SQL Server is Asymmetric, this means that value1 BETWEEN value2 AND value3 is the same as Value1 >= Value2 AND Value1 <= Value3, so the value value2 that before the AND must be less than or equal to the value3.

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

Sidebar

Related Questions

Trying to join two tables stored in database on a PID and storing the
I'm trying to join two relatively simple tables together, but my query is experiencing
Trying to create an outer join on two other joined tables when recieving this
i am trying to select information from my mysql database with this statement after
I've trying to do an inner join select statement where I select two fields
I am trying to make a form using two drop down select menus: one
I have two tables that I'm trying to create a relationship between so I
Im trying to make a a query, but its doubling the Sum values SELECT
i am trying to make a query but it is not right. what i
Im trying to make some queries, first, I do this one (and works): SELECT

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.