I have a connection to MSSQL database which I use mssql_query and mssql_fetch_assoc
I have problem when I use a join in the statement.
when just connecting to a single table in the SQL part
SELECT id, sName, iStatus
FROM [SQL01].[dbo].[KPIDay]
Select all Open in new window
If i do not put the [sqldatabase].[dbo].[table
name]
I get an internal error
but I am stuck with is statement work in sql builder but no in php
SELECT Lead_T.sName AS Expr1, LeadSource_T.sName, TransferClient_T.sName AS Client, TransferSubscription_T.sName AS Subs, LeadTransfer_T.zXUpdtdWhn AS Date,
LeadTransfer_T.zXUpdtdBy AS [Updated By], TransferClient_T.id
FROM TransferClient_T INNER JOIN
LeadSource_T INNER JOIN
LeadTransfer_T ON LeadSource_T.id = LeadTransfer_T.FKiSourceID INNER JOIN
Lead_T ON LeadTransfer_T.FKiLeadID = Lead_T.id ON TransferClient_T.id = LeadTransfer_T.FKiClientID INNER JOIN
TransferSubscription_T ON LeadTransfer_T.FKiSubscriptionID = TransferSubscription_T.id
WHERE (LeadTransfer_T.zXUpdtdWhn BETWEEN CONVERT(DATETIME, '2012-10-29 00:00:00', 102) AND CONVERT(DATETIME, '2012-10-29 23:59:59', 102)) AND
(TransferClient_T.id = 27)
ORDER BY TransferClient_T.zXUpdtdWhn, Date, LeadSource_T.sName DESC
Select all Open in new window
not sure where I need the [sqldatabase].[dbo].[table
name]