B
Blaze
Charges is a linked table via Sharepoint.
Blaze
Blaze
Ken Snell said:One query can use another query as a "table" -- just as if it existed as a
permanent table. The query will run the other query in order to get its
records and use them as data source.
OK - post the SQL statement of Charges query. I'm betting that what we're
seeking is in there....
--
Ken Snell
<MS ACCESS MVP>
Blaze said:Charges is just another Query. I didn't know I could use a Query to run a
Query. That's an interesting addition to the utility.
Sorry for the wrong SQL Statement.
Blaze
****
Ahhh.. this is a different query than the one you posted on 8/31/2005.
OK - you said that, if you remove the "Charges" portion of the query, it
works without giving you the error. So, is Charges a table, or is it a
query? If it's a query, what is its SQL statement? Somewhere in the
Charges
portion, the query thinks it needs to use some reference to that Arrest
Report Generator object.
--
Ken Snell
<MS ACCESS MVP>
Blaze said:Well, I thought I posted the correct thing. Here's what I did. In the
Query
that I'm having issues with, I clicked "Design View".
From there I click the View, SQL View, thus showing the SQL Query. Here
it
is again. Thank you for hanging in there, because it makes absolutly NO
sense to me how this can happen. But as I am sure you are aware of, it
is
near impossible to develop if you can run the query to verify whether it
works or not.
SELECT [Booking ID (BID): All Items].ID, [Arrest Reports: All
Forms].Person1Bid, [Booking ID (BID): All Items].[Full Name (First
Last)],
[Inmate Records: All Forms].DOB, [Inmate Records: All Forms]!DLState & "
"
&
[Inmate Records: All Forms]!DLNumber AS Expr4, [Inmate Records: All
Forms].PhoneNumber, [FirstName] & " " & [LastName] AS Expr1, [Inmate
Records:
All Forms].NameSuffix, [Inmate Records: All Forms].MiddleName, [Inmate
Records: All Forms].[SSNY-N], [Inmate Records: All Forms].InmateSSN,
[Inmate
Records: All Forms].PrimaryAddy, [PrimaryCity] & "," & [PrimaryState] & "
"
& [PrimaryZipCode] AS Expr2, [Inmate Records: All Forms].PrimaryCity,
[Inmate
Records: All Forms].PrimaryState, [Inmate Records: All
Forms].PrimaryZipCode,
Charges.[Charge Name] AS Charge0, Charges.[Statute Number] AS Statute0,
IIf([Charges.Charge Name] Is Null,"No Charges",[Charges.Charge Name] & "
"
&
[Statute0]) AS [Charge0 Name and Statute], Charges_1.[Charge Name] AS
Charge1, Charges_1.[Statute Number] AS Statute1, IIf([Charges 2] Is
Null,"
",[Charges_1.Charge Name] & " , " & [Statute1]) AS [Charge 1 Name and
Statute], Charges_2.[Charge Name] AS Charge2, Charges_2.[Statute Number]
AS
Statute2, IIf([Charges 3] Is Null," ",[Charges_2.Charge Name] & " , " &
[Statute2]) AS [Charge 2 Name and Statute], Charges_3.[Charge Name] AS
Charge3, Charges_3.[Statute Number] AS Statute3, Charges_4.[Charge Name]
AS
Charge4, Charges_4.[Statute Number] AS Statute4, [Booking ID (BID): All
Items].[Where Arrested], Locations.[City Name], Locations.[Zip Code],
[Radio
ID].[Radio ID], [Radio ID].[Full Name], [Radio ID].[Job Title], [Arrest
Reports: All Forms].Narrative2, [Arrest Reports: All
Forms].ReportedDateTime,
[Arrest Reports: All Forms].Name, [Booking ID (BID): All Items].[How
Discharged], [Booking ID (BID): All Items].[Discharge Date], [Booking ID
(BID): All Items]![Discharge Date]-[Booking ID (BID): All Items]![Date
Commited] AS Expr3, [Dispatch Log: All Items].[Event Subject], [Dispatch
Log:
All Items].[Type of Call], [Dispatch Log: All Items].[Description of
Call],
[Dispatch Log: All Items].[Created By], [Dispatch Log: All Items].Date,
[Dispatch Log: All Items].Time, [Dispatch Log: All Items].[Radio ID],
[Evidence Forms: All Documents].Name AS [Evidence File Name],
IIf([Evidence
Forms: All Documents.Name] Is Null,"No Evidence File on Record",[Evidence
File Name]) AS [Evidence File Name if True], "" AS [Narrative Section],
[Arrest Reports: All Forms].NarrativeBuilderText AS [Narrative Builder
NARRATIVE TEXT], Replace([Arrest Reports: All
Forms]!NarrativeBuilderText,Chr(10),Chr(13) & Chr(10)) AS [Narrative
Builder
REPLACE]
FROM (((((([Arrest Reports: All Forms] LEFT JOIN (((((([Booking ID (BID):
All Items] LEFT JOIN [Inmate Records: All Forms] ON [Booking ID (BID):
All
Items].[Inmate Record (ISSN)] = [Inmate Records: All Forms].ID) LEFT JOIN
Charges ON [Booking ID (BID): All Items].Charges = Charges.ID) LEFT JOIN
Charges AS Charges_1 ON [Booking ID (BID): All Items].[Charges 2] =
Charges_1.ID) LEFT JOIN Charges AS Charges_2 ON [Booking ID (BID): All
Items].[Charges 3] = Charges_2.ID) LEFT JOIN Locations ON [Booking ID
(BID):
All Items].[Location ID] = Locations.ID) LEFT JOIN [Radio ID] ON [Booking
ID
(BID): All Items].[Arresting Officer] = [Radio ID].ID) ON [Arrest
Reports:
All Forms].Person1Bid = [Booking ID (BID): All Items].ID) LEFT JOIN
[Dispatch
Log: All Items] ON [Booking ID (BID): All Items].ID = [Dispatch Log: All
Items].[BID Reference]) LEFT JOIN Charges AS Charges_3 ON [Booking ID
(BID):
All Items].[Charges 4] = Charges_3.ID) LEFT JOIN Charges AS Charges_4 ON
[Booking ID (BID): All Items].[Charges 5] = Charges_4.ID) LEFT JOIN
Charges
AS Charges_5 ON [Booking ID (BID): All Items].[Charges 6] = Charges_5.ID)
LEFT JOIN Charges AS Charges_6 ON [Booking ID (BID): All Items].[Charges
7] =
Charges_6.ID) LEFT JOIN [Evidence Forms: All Documents] ON [Booking ID
(BID):
All Items].ID = [Evidence Forms: All Documents].[BID Reference]
WHERE ((([Arrest Reports: All Forms].Person1Bid)=[BID]));
Again, thank you for your experience in this situation!
Blaze
Ken Snell said:Hmm.. I don't have experience with SharePoint, but let's see the SQL
statement that you're using and let's see what we might suggest...
--
Ken Snell
<MS ACCESS MVP>
I have a Query that runs and it grabs information from about 7-10 tables
(sharepoint based linked tables). This query is a somewhat simple
query
that
has quite a few IIF statements. The name is called "Arrest Report
Generator". This then creates a report called "Arrest Report
Generator".
The Report runs without issue and works fine asking a basic question to
pick
the right report out of a table. It then populates the report
correctly
running the Query "Arrest Report Generator".
Now if I run the Query from outside the Design, it gives me the error
""The
Microsoft Jet database engine could not find the object ". Make sure
the
object exists and that you spell its name and the path name correctly.
(Error
3011)"
I am trying to edit the Query and when I click the "!" to temp run the
Query, it asks the basic question and then gives an error stating:
"The Microsoft Jet database engine could not find the object 'Arrest
Report
Generator'. Make sure the object exists and that you spell its name
and
the
path name correctly. (Error 3011)"
Do you still need SQL Syntax?
Blaze
:
Define "won't run by itself" vs. "the report runs fine".... what are
you
running as a query? what is the query's relationship to the report?
what
is
the query's SQL statement? etc. need more details, please....
--
Ken Snell
<MS ACCESS MVP>
I have a Report that runs fine, but the query will not "run" by
itself.
Any ideas out there.
Thanks,
Blaze