I'm inserting records into a table on a daily basis from 3 source tables that are updated in real-time. I want to capture records entered between midnight to 11:59pm of the previous day.
Somthing like
INSERT INTO destination_table
SELECT * FROM source_tables
WHERE entry_date = dateadd(day,-1,getdate())
Problem is, the entry_date field and getdate() both include times as well as dates. Any suggestions on how to use getdate() excluding the time portion and simply returning the date?
Thanks in advance,
Jon
Somthing like
INSERT INTO destination_table
SELECT * FROM source_tables
WHERE entry_date = dateadd(day,-1,getdate())
Problem is, the entry_date field and getdate() both include times as well as dates. Any suggestions on how to use getdate() excluding the time portion and simply returning the date?
Thanks in advance,
Jon