oledb query problem

  • Follow


Hello.  I have a connection with a Access 2007 db back end (tables only) 
using OLEDB.  The db is on a shared drive on the network.  So a UNC is used.  
A simple query works but a query in which other tables are included just 
never works.  Here is the query I'm trying to use;

SELECT 
 tblChangeRequest.ChangeRequestID, 
 tblChangeRequest.ChangeRequest, 
 tblChangeRequest.DevCompletionDate, 
 tblProjectLead.ProjectLead, 
 tblSPGName.SPGName, 
 tblChangeRequest.QuickHit, 
 tblChangeRequest.BugFix

FROM (((tblChangeRequest 
 LEFT JOIN tblProjectLead ON tblChangeRequest.ProjectLeadID = 
tblProjectLead.ProjectLeadID) 
 LEFT JOIN tblSPGName ON tblChangeRequest.SPGNameID = tblSPGName.SPGNameID) 
 LEFT JOIN tblChangeRequestStatus ON tblChangeRequest.ChangeRequestStatusID 
= tblChangeRequestStatus.ChangeRequestStatusID

WHERE (((tblChangeRequest.DevCompletionDate)>=?) AND 
((tblChangeRequest.DevCompletionDate)<?) AND 
((tblChangeRequest.ChangeRequestStatusID)=6))

ORDER BY tblChangeRequest.DevCompletionDate

I get errors regarding near the ON in the WHERE and so on.  If I build the 
query from scratch by adding a little at a time, when adding a table and 
making the relationship to show all rows from tblChangeRequest, I get '{ oj' 
in the FROM clause.

This is beginning to get frustrating so I seek help from the newsgroup.  
What is wrong with the above query?  Also, in the part above 
((tblChangeRequest.DevCompletionDate)<?)   I would like to add a +1 so when 
the user enters the date, the result includes the date.  I have tried <=, 
datediff, dateadd and nothing appears to work.

Help!

Thanks.
John
0
Reply Utf 1/15/2010 3:55:04 PM

Thanks to anyone who might have read this but I got it figured out, I hope. 
John


"JohnE" wrote:

> Hello.  I have a connection with a Access 2007 db back end (tables only) 
> using OLEDB.  The db is on a shared drive on the network.  So a UNC is used.  
> A simple query works but a query in which other tables are included just 
> never works.  Here is the query I'm trying to use;
> 
> SELECT 
>  tblChangeRequest.ChangeRequestID, 
>  tblChangeRequest.ChangeRequest, 
>  tblChangeRequest.DevCompletionDate, 
>  tblProjectLead.ProjectLead, 
>  tblSPGName.SPGName, 
>  tblChangeRequest.QuickHit, 
>  tblChangeRequest.BugFix
> 
> FROM (((tblChangeRequest 
>  LEFT JOIN tblProjectLead ON tblChangeRequest.ProjectLeadID = 
> tblProjectLead.ProjectLeadID) 
>  LEFT JOIN tblSPGName ON tblChangeRequest.SPGNameID = tblSPGName.SPGNameID) 
>  LEFT JOIN tblChangeRequestStatus ON tblChangeRequest.ChangeRequestStatusID 
> = tblChangeRequestStatus.ChangeRequestStatusID
> 
> WHERE (((tblChangeRequest.DevCompletionDate)>=?) AND 
> ((tblChangeRequest.DevCompletionDate)<?) AND 
> ((tblChangeRequest.ChangeRequestStatusID)=6))
> 
> ORDER BY tblChangeRequest.DevCompletionDate
> 
> I get errors regarding near the ON in the WHERE and so on.  If I build the 
> query from scratch by adding a little at a time, when adding a table and 
> making the relationship to show all rows from tblChangeRequest, I get '{ oj' 
> in the FROM clause.
> 
> This is beginning to get frustrating so I seek help from the newsgroup.  
> What is wrong with the above query?  Also, in the part above 
> ((tblChangeRequest.DevCompletionDate)<?)   I would like to add a +1 so when 
> the user enters the date, the result includes the date.  I have tried <=, 
> datediff, dateadd and nothing appears to work.
> 
> Help!
> 
> Thanks.
> John
0
Reply Utf 1/15/2010 5:00:01 PM


1 Replies
254 Views

(page loaded in 0.056 seconds)

8/30/2012 10:11:42 AM


Reply: