SQL in Access ignore Where clause

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

cydlawenhau

Thread Starter
Joined
Oct 7, 2008
Messages
2
I have a query which then drives a PivotChart reporting trend data.
For the life of me, I can not see what is wrong with this query though. Whenever I run it, Access displays results that ignore the WHERE date limitations.
If I remove the reference to the form and fill the data as a specific date the same thing happens.

Code:
SELECT MainEntry.ID, MainEntry.TaskNo, MainEntry.GeneratedOn, MainEntry.HandledOn, MainEntry.AgentHandled, MainEntry.AgentAbout, MainEntry.NPSScore, MainEntry.Category, MainEntry.Comment, MainEntry.FollowedUp
FROM MainEntry
WHERE (((FormatDateTime([MainEntry].[GeneratedOn],2))>=FormatDateTime([Forms]![MakeReports].[startDate],2) And (FormatDateTime([MainEntry].[GeneratedOn],2))<=FormatDateTime([Forms]![MakeReports].[endDate],2)))
ORDER BY MainEntry.GeneratedOn;
 

OBP

Joined
Mar 8, 2005
Messages
19,895
You use the syntax Between date1 AND date2, not ">=" and "<="
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top