Hi Mike,
Here's the query:
SELECT
ReportedWeeds.RID, Weeds.Name, ReportedWeeds.Density,
BioAgents.BName,
ReportedWeeds.Assr_SN, ReportedWeeds.TownRange, ReportedWeeds.LotSize,
ReportedWeeds.theDate, ROW.[Desc] AS RDesc, ReportedWeeds.Owner,
ReportedWeeds.OwnStAddrs, ReportedWeeds.OwnCity, ReportedWeeds.OwnState,
ReportedWeeds.OwnZip, ReportedWeeds.OwnPhone, MethodContacted.[Desc] AS
MDesc, ReportedWeeds.SitusHsnbr + ' ' + ReportedWeeds.SitusStDir + ' ' +
ReportedWeeds.SitusStName + ' ' + ReportedWeeds.SitusSType + ' ' +
ReportedWeeds.SitusCity AS SITADDRS, ReportedWeeds.Source,
ReportedWeeds.SourceCity, ReportedWeeds.SourceState,
ReportedWeeds.SourceStDir,
ReportedWeeds.SourceHsnbr, ReportedWeeds.SourceStName,
ReportedWeeds.SourceZip, ReportedWeeds.SourcePhone,
ReportedWeeds.Comments, ReportedWeeds.FollowUp,
ReportedWeeds.FollowUpNotes,
ReportedWeeds.Atlas
FROM ((((ReportedWeeds LEFT OUTER JOIN
ROW ON ReportedWeeds.ROWID = ROW.ROWID) LEFT OUTER JOIN
Weeds ON ReportedWeeds.WID = Weeds.WID) LEFT OUTER JOIN
MethodContacted ON ReportedWeeds.MCID = MethodContacted.MCID) LEFT OUTER
JOIN
BioAgents ON ReportedWeeds.BioAgent = BioAgents.BAID)
WHERE (ReportedWeeds.Source LIKE '%' + ? + '%') AND
(ReportedWeeds.theDate
= ?) AND (ReportedWeeds.theDate <= ?)
What I found was that the concatenated field was causing the problem.
I'm thinking that Access thinks the + character is for adding numbers
(i.e., double) and that's what's producing the error. However, if I
change the concatenation to characters Access likes to use (i.e., the
ampersand and the double quote), then the designer doesn't like that.
So, it's like a catch 22 here. What I'm doing in the interim is just
including the fields and concatenating the values for those fields and
passing it to my reports. Ugly but it's working for now. I would love to
have it work like it's supposed to..
Thanks for looking
S
Can you send the query with the problem so it can be inspect or
correctness?
--
Mike
Mike McIntyre [MVP]
http://www.getdotnetcode.com
Hello,
Using the designer in my project, I created a DataTable for one of the
tables in an Access database. I created a TableAdapter for that
DataTable by adding queries. For the most part, the queries are
executing correctly but this one does not return any rows. If I past
the sql into the Access database from the TableAdapter, it returns
rows. Does anyone know how to debug what the command is sending to the
Access database for any particular query?
This query uses parameters and I'm afraid it's not sending the where
clause correctly..
Any help with this would be much appreciated
S