Why does this query ask for the start date and end date twice?

G

GWB

SELECT Data1.Date, Data1.Shift, Data1.Thickness, Data1.Species, Data1.Plies,
Data1.ValueLeft, Data1.ValueRight
FROM Data1
WHERE (((Data1.Date)>=[Start Date] And (Data1.Date)<=[Stop Date]));


Thanks for any help
 
K

KARL DEWEY

Because it has this --
WHERE (((Data1.Date)>=[Start Date] And (Data1.Date)<=[Stop Date]));
and the objects [Start Date] and [Stop Date] are not fields in your
table Data1.
 
G

GWB

What would be a better way to do it Karl?

Thanks in advance

KARL DEWEY said:
Because it has this --
WHERE (((Data1.Date)>=[Start Date] And (Data1.Date)<=[Stop Date]));
and the objects [Start Date] and [Stop Date] are not fields in your
table Data1.

--
Build a little, test a little.


GWB said:
SELECT Data1.Date, Data1.Shift, Data1.Thickness, Data1.Species, Data1.Plies,
Data1.ValueLeft, Data1.ValueRight
FROM Data1
WHERE (((Data1.Date)>=[Start Date] And (Data1.Date)<=[Stop Date]));


Thanks for any help
 
J

John Spencer

Probably because you have applied a sort while in datasheet view and saved it.
This sometimes causes a query to run twice when you are showing the results
in datasheet view.

Quickest way to fix the problem is probably to copy the SQL. Open a new query
and paste the SQL into the new query's SQL view. Then Save the new query over
the old query.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
G

GWB

Thanks John

John Spencer said:
Probably because you have applied a sort while in datasheet view and saved it.
This sometimes causes a query to run twice when you are showing the results
in datasheet view.

Quickest way to fix the problem is probably to copy the SQL. Open a new query
and paste the SQL into the new query's SQL view. Then Save the new query over
the old query.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
SELECT Data1.Date, Data1.Shift, Data1.Thickness, Data1.Species, Data1.Plies,
Data1.ValueLeft, Data1.ValueRight
FROM Data1
WHERE (((Data1.Date)>=[Start Date] And (Data1.Date)<=[Stop Date]));


Thanks for any help
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top