Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

local / SQL conflict

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pmacdiddie@gmail.com - 15 Jan 2008 02:54 GMT
I am having trouble getting this query to run in code.   It fails with
the following error [Microsoft][ODBC SQL Server Driver][SQL Server]
'First' is not a recognized function name.   The tblQualitySurvey is
on SQL Server, tblJobs and Customers are jet tables on a server on
property.  All tables are attached.

When I paste the SQL string from the debug window into a query window,
it runs fine.  By the way, I had this running on another machine where
it did not question the syntax.

cnn.Open "Driver={SQL
Server};Server=sqla15.zbaenter.com;Database=spi2000;Uid=dev;Pwd=password"

Dim strSQL As String

INSERT INTO developer_tblQualitySurvey ( Company, Job_Num, QS_Date,
First_Name, Customer_Number, Email, Job_Num_Count ) SELECT
Customers.Company, First(tblJobs.Job_Num) AS FirstOfJob_Num,
First(#12/24/2007#) AS Expr1, Customers.[First Name], Customers.
[Customer Number], Customers.Email, Count(tblJobs.Job_Num) AS
CountOfJob_Num FROM Customers INNER JOIN tblJobs ON Customers.
[Customer Number] = tblJobs.[Customer Number] Where
(((tblJobs.Confirmed)='Yes') AND ((tblJobs.StrikeCall) > #12/17/2007#
And (tblJobs.StrikeCall) <= #12/24/2007#)) GROUP BY
Customers.Company,
Customers.[First Name], Customers.[Customer Number], Customers.Email
HAVING(((Customers.EMail) Is Not Null)) WITH OWNERACCESS OPTION;

Thanks, Preston
Brendan Reynolds - 15 Jan 2008 10:29 GMT
There's no built-in function called "First" in T-SQL. Is it a custom
function? If so, you may need to specify the owner of the function, e.g.
"dbo.First" if dbo is the owner of the function.

Signature

Brendan Reynolds

>I am having trouble getting this query to run in code.   It fails with
> the following error [Microsoft][ODBC SQL Server Driver][SQL Server]
[quoted text clipped - 25 lines]
>
> Thanks, Preston
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.