Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 07/28/2013 :  08:59:26  Show Profile  Reply with Quote
Hi All,

I am trying to pull the data from Salesforce using sql server.
I would like to pull all the data where CreatedDate= GETDATE()-1 but it throws me an error.

Is there any other way to import only yesterdays data? This should be an automatic process. this should be scheduled and run everyday.

Here is my query:
Select * into Contacts
From (openquery,SALESFORCE 'Select Id From Contacts Where CreatedDate=GETDATE()-1)'

I can run other queries and import. but it throws me an error whenever i filter with date.

I appreciate your help.
Thanks in advance


Premature Yak Congratulator

22864 Posts

Posted - 07/28/2013 :  10:07:21  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
where createdDate>=dateadd(day,datediff(day,0,getdate())-1,0) and createdDate<dateadd(day,datediff(day,0,getdate()),0)

More examples at


Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000