Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rookie_sql
Constraint Violating Yak Guru
443 Posts |
Posted - 2007-09-04 : 07:08:49
|
Hi i have a problem in that some days my data i pick up and transfer to my DB is not always at the source, so my job runs and doe snot pick up any data for the pervious day. The next day it will run again but only picks up the data for the pervious day, its always getdate() -1. Is there any way i can know if no data was loaded and some way of reloading the data which was not loaded, Take into account, that am working with orders and i can have many of the same orders numbers so i can'#t do a check that way.. the only thing i can think of working with would be the date.. |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-04 : 07:13:46
|
SELECT *FROM YourTableWHERE DateTimeColumn >= DATEADD(DAY, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP), 0) -- TodayAND DateTimeColumn < DATEADD(DAY, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP), 1) -- Tomorrow E 12°55'05.25"N 56°04'39.16" |
|
|
|
|
|