This query is typed incorrectly or is too complex to be evaluated.

G

GWB

I'm trying to retrieve records with a start date and stop date criteria. The
format of the Date column in my table is general date.
I dont understand why it wont work


FROM [Spreadcheck on this laptop]
WHERE (((([Spreadcheck on this laptop].Date)>=[Start Date] AND [Spreadcheck
on this laptop].Date)<[Stop Date]));
 
G

GWB

OK - I guess the brackets are the problem.... it work now, but asks for the
start time and stop time twice! Thanks for any help
 
D

Duane Hookom

I surprised it gets even that far without a SELECT statement.

If you have an issue with a query, it is customary to post all the SQL.

--
Duane Hookom
Microsoft Access MVP


GWB said:
OK - I guess the brackets are the problem.... it work now, but asks for the
start time and stop time twice! Thanks for any help

GWB said:
I'm trying to retrieve records with a start date and stop date criteria. The
format of the Date column in my table is general date.
I dont understand why it wont work


FROM [Spreadcheck on this laptop]
WHERE (((([Spreadcheck on this laptop].Date)>=[Start Date] AND [Spreadcheck
on this laptop].Date)<[Stop Date]));
 
J

John W. Vinson

OK - I guess the brackets are the problem.... it work now, but asks for the
start time and stop time twice! Thanks for any help

Please copy and paste the complete SQL of the query.

You may need to use its Parameters; you should CERTAINLY rename the field Date
since that's a reserved word; and you should probably use a Form to collect
the parameters rather than a prompt like [Enter date]. To do so create an
unbound form (let's call it frmCrit) with textboxes txtStart and txtEnd; your
query would then be

SELECT <whatever you want to see>
FROM [Spreadcheck on this laptop]
WHERE (((([Spreadcheck on this laptop].[renamedDate]) >=
[Forms]![frmCrit]![txtStart] AND [Spreadcheck on this laptop].[renamedDate]) <
DateAdd("d", 1, [Forms]![frmCrit]![txtEnd])));

The DateAdd bit ensures that if the Date field contains a time portion you get
the data from the last day of the range.
 

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