DATEADD(day, -7, GETDATE()) – Does it take time into account?

I am writing a SQL query in Aginity through Amazon Redshift to extract the last 7 days of data. The Date column which I am calling is in the variable type:

DATE

  • How to find a text inside SQL Server procedures / triggers?
  • Group by hour but show another field
  • Does the SQL Server clustered index replace the RID lookup “index”
  • Stored procedure - searching not just one column
  • Insert, select and update DateTime
  • Cascade on delete performance: Whats the fastest way to delete a row its 1-Many rows?
  • An example output is this:

    5/30/2017 0:00

    When I call the below function, does it matter what time of day I run this query or will it always take the full day’s worth of data?

    WHERE Date >= DATEADD(day,-7, GETDATE())

  • SQL Server Query to Transform a poorly collected date into a usable date to analyse age
  • How to get first day of the week and last day of the week in sql server 2008?
  • Comparing dates stored as varchar
  • Simplest way to create a date that is the first day of the month, given another date
  • Improving performance of wildcard date pattern searchs
  • How to get monthly data from three separate table
  • One Solution collect form web for “DATEADD(day, -7, GETDATE()) – Does it take time into account?”

    Yes, this includes the current time component when subtracting 7 days. To get rid of that, convert to a date:

    WHERE Date >= CAST(DATEADD(day, -7, GETDATE()) as DATE)
    
    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.