29. April 2011 15:26
SELECT [test_MSCRM].[dbo].[FilteredIncident].incidentid
, [test_MSCRM].[dbo].[FilteredIncident].createdon
,(Select [test_MSCRM].[dbo].[FilteredActivityPointer].createdon From [test_MSCRM].[dbo].[FilteredActivityPointer] where [test_MSCRM].[dbo].[FilteredActivityPointer].regardingobjectid = [test_MSCRM].[dbo].[FilteredIncident].incidentid)
FROM [test_MSCRM].[dbo].[FilteredAccount] INNER JOIN
[test_MSCRM].[dbo].[FilteredIncident] ON [test_MSCRM].[dbo].[FilteredAccount].accountid = [test_MSCRM].[dbo].[FilteredIncident].new_companyid
WHERE ([test_MSCRM].[dbo].[FilteredIncident].new_companyid = '83796e6e-61f0-de11-8a41-00188bc4ed5a') AND (DATEDIFF(m, [test_MSCRM].[dbo].[FilteredIncident].createdon, GETDATE()) <= 1)
Meldung 512, Ebene 16, Status 1, Zeile 2
Die Unterabfrage hat mehr als einen Wert zurückgegeben. Das ist nicht zulässig, wenn die Unterabfrage auf =, !=, <, <=, > oder >= folgt oder als Ausdruck verwendet wird.
6. Mai 2011 00:45
6. Mai 2011 10:45
SELECT DATEDIFF(d, FilteredIncident.createdon, FilteredActivityPointer.createdon) as IncidentDureation,FilteredAccount.name, FilteredIncident.ticketnumber, FilteredIncident.createdon AS IncidentCreatedon, FilteredActivityPointer.createdon AS ActivityCreatedon,
FilteredActivityPointer.activitytypecodename,FilteredActivityPointer.activitytypecode
FROM FilteredAccount INNER JOIN
FilteredIncident ON FilteredAccount.accountid = FilteredIncident.new_companyid right outer JOIN
FilteredActivityPointer ON FilteredIncident.incidentid = FilteredActivityPointer.regardingobjectid
where (FilteredIncident.new_companyid = '83796e6e-61f0-de11-8a41-00188bc4ed5a')
order by incidentid
and FilteredActivityPointer.activitytypecode = 4206
6. Mai 2011 12:12