user2225470
user2225470

Reputation: 41

SQL query for limiting records

I have following SQL query in Data Flow, Control flow of SSIS package and I want to limit records by cutting off point, and that cut off point is current day/date from system. So, it should only display past records, not including todays. So, I think I need to use the specific field (which is date field - in the query its called 'FinalCloseDate' and compare with current system date and tell it to only to pull the records (perhaps < todays date) that happened before today or current system day.

Upvotes: 2

Views: 60

Answers (1)

Cade Roux
Cade Roux

Reputation: 89731

Add

AND dbo.Producthit.FinalCloseDate < CAST(GETDATE() AS DATE)

to your WHERE clause.

Upvotes: 2

Related Questions