Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Multiple parameters in where clause

I am trying to write a select statement that will have multiple parameters. Here is what I'm trying to do.

declare @BeginDate Date
declare @EndDate Date
set @BeginDate = '2018-05-01'
set @EndDate = '2018-05-31'

Select * from openquery(salesforce,
'Select Id, Service_Center_Area__r.Name, Service_Center_Name_Text__c, Owner.Name, CreatedDate, CaseNumber, ClosedDate, Timestamp__c, Priority,
Dispatch_Requester__r.Name, Task__c
From Case
WHERE Case.RecordType.DeveloperName = ''Sales_Service_Center''
And Day_Only(CreatedDate) >= @BeginDate
And Day_Only(CreatedDate) )

The example in the documentation only shows one parameter, and I can get that to work, but I have to leave off the Order By clause. How do I use multiple parameters and keep the Order By clause. There will also be more parameters that just the dates.
1 person has
this question
+1
Reply