Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Difference

Status
Not open for further replies.

gsavitha

MIS
Jan 28, 2011
14
GB
Dear All,

we have 2 db and i try to retrview yesterdays records from both db,i used

where cst.DateCreated >=DATEADD(dd,DATEDIFF(dd,0,GETDATE())-1,0)AND cst.DateCreated <DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0)

In one DB its pull exactly yesterday record and in another DB it pulls day before yesterday records.Why this difference and how to fix this.Any help will be highly appreciated.Many Thanks.

Reagrds,
SG
 
I'm going to ask dumb questions:

Are the databases on the same server?

Have you verified the data?
Have you re-run this since?

What is the time zone is the data being entered in, if different than your own (I've had this problem).

Lodlaiden


I haz all the letters: SME, BA, QA, PM, DEV, DBA, UAT, SE, HD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top