Link to home
Start Free TrialLog in
Avatar of Gemini G
Gemini GFlag for United States of America

asked on

Query based on Cartesian query with date parameter not working.

Recur-NEW-2-22-2018.accdbGreetings Experts:

I'm having trouble making a query that is based on another Cartesian query.  
The query is named 1-testdue. It is used to query all events due within a parameter date range.
I can't get it to work correctly, looks like it's pulling Cartesian values for all records.
I need to pull only each instance of event that are due within a certain date range.
Please advise.
Thanks!
Avatar of Bill Prew
Bill Prew

You would want to share a bit more information, and the code of the queries involved, along with sample data.


»bp
Avatar of Gemini G

ASKER

Sorry guess it didn't load first time
The whole point of a Cartesian Product is to multiple the rows in tbl1 by the rows in tbl2 so EVERY row in tbl1 gets matched with every row in tbl2.  If tbl1 has 50 rows and tbl2 has 100 rows, the result set will be 50 * 100 = 5000 rows.

It would be more helpful if you tell us why you are using the Cartesian Product.  What real world function are you trying to model?
You have posted this or similar several times, but I guess no one understands what you are trying to do, not to mention why.

Your last date is 2127-01-01 so that will probably include any due date, and to find some due dates, you don't need to generate all dates between now and 2127.
Thus, it seams, you need to rethink your concept.
The cartesian (or cross join query) in this instance is used to produce all recurring instances of an assigned event. If you look at the website http://allenbrowne.com/AppRecur.html this expert will show the reasoning why. Perhaps that will help you understand the concept and what I am trying to do.
Oh, you miss the parameters.
Edit the SQL of the query to have this top line to proceed the Select statement:

PARAMETERS [Enter start] DateTime, [Enter end] DateTime;
SELECT ...

Open in new window

My query already has those parameters in the query designer
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks
That worked Thanks!
You are welcome!