Alternative to Parameter in Query

  • Thread starter Thread starter Renee
  • Start date Start date
R

Renee

I have written a query that is then accessed by a Crystal
Report. I need to be able to enter something like a
parameter (ex. month end date) that can be changed
periodically but not necessarily when the Crystal Report
is run. In other words I want to be able to save the
value and reference it in a query without requiring user
intervention. I do not use VB but if needed can modify my
application if someone tells me how. I generally use the
design view exclusively. I have tried saving the value to
a 1 record, 1 field table but get a JOIN error if used in
my query. Can I set up a variable or a constant? If I
do, can you provide the syntax and how I would reference
the field in my query?
 
Renee,
Did you try putting your 1 record with 1 field in the
query, but not joining it to your other table(s)? I used
to do something like that at work, before we started
writing our queries in code. Give it a try.
 
Les,

Thanks for your suggestion but I've already tried this
without success. I get the following error:

"The SQL statement could not be executed because it
contains ambiguous outter joins..."

I could just enter the date into the query (in several
places) but fear that it would be more prone to error or
omission.

Renee
 
Oh,
Now I see. You have join(s) where you want everything
from 1 table and only those that match from another. If
you don't want to get into code, you could perhaps make
your query into 2 queries, the first using your date table
and the table that selects based on the date. Then, use
this query and join to your other table(s).
 
Back
Top