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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:43:36+00:00 2026-05-22T23:43:36+00:00

What I thought was simple turned out to be a nightmare . . .

  • 0

What I thought was simple turned out to be a nightmare . . .
The table I am trying to get the data out of is very simple:

R_TYPE (string)
R_PRICE (currency)
S_DATE (date)
E_DATE (date)

I run:

SELECT * 
  FROM MYTABLE 
 WHERE R_TYPE = :a1 
   AND R_PRICE BETWEEN S_DATE = :a2 
                   AND E_DATE = :a3

Parameters are:

ABSQuery1.params.ParamByName('a1').asString :=cxTextEdit;
ABSQuery1.params.ParamByName('a2').asDate := DateTimePicker1;
ABSQuery1.params.ParamByName('a3').asDate := DateTimePicker2;

But it wont work…. 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-22T23:43:37+00:00Added an answer on May 22, 2026 at 11:43 pm

    Your query is muddled: Price can’t be between the boolean result of date comparisons.

    If the date picker is picking any price that had its entire duration (ie it started and ended) between the dates picked, use this:

    select * from MYTABLE where R_TYPE = :a1 and S_DATE > :a2 AND E_DATE < :a3;
    

    If the date picker is picking any price that had some duration between the dates picked (ie there was at least some overlap of the date range picked and the price’s date range), use this:

    select * from MYTABLE where R_TYPE = :a1 and S_DATE < :a3 AND E_DATE > :a2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought it is a very simple task to export data in a view
I was trying to do something I thought would be simple but has turned
What I thought should be a fairly simple search, turned out to be alot
I am trying to do something I thought would be simple. I have a
Ok - I'm pulling my hair out over what I thought was a simple
actually I thought I was trying something really simple. ControllerClassNameHandlerMapping sounded great to produce
I thought I'd use some (what I thought was) simple generics to enforce CRUD
I am attempting to do something simple (I thought) - securing my application using
I thought this would be simple, but its not working .. in both the
I thought it was alias for simple foreign key relation ,but seems not. Can

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.