Receiving Helpdesk

how do i subtract days from a date in sql

by Jaylen Weissnat I Published 3 years ago Updated 2 years ago

How do I subtract days from a date in SQL?

  • Add one year to a date, then return the date: SELECT DATEADD (year, 1, '2017/08/25') AS DateAdd;
  • Add two months to a date, then return the date:
  • Subtract two months from a date, then return the date:
  • Add 18 years to the date in the BirthDate column, then return the date:

We can use DATEADD() function like below to Subtract days from DateTime in Sql Server. DATEADD() functions first parameter value can be day or dd or d all will return the same result.

Full Answer

How to select date without time in SQL?

select convert (varchar (10), '2011-02-25 21:17:33.933', 120) 120 here tells the convert function that we pass the input date in the following format: yyyy-mm-dd hh:mi:ss. The fastest is datediff, e.g. select dateadd (d, datediff (d,0, [datecolumn]), 0), other.. from tbl. But if you only need to use the value, then you can skip the dateadd, e.g ...

How to subtract time from time in SQL?

Syntax

  • datepart = datepart is the part of date to which DATEADD adds an integer number.
  • number = number is the integer value to be added or subtracted to the datepart of the Specified Date.
  • date = date is a literal date value or an expression that can resolve to a value of type DATE, DATETIME, DATETIMEOFFSET, DATETIME2, SMALLATETIME, or TIME.

What is the current date in SQL?

To get the current date and time of the database server, you use the SQL CURRENT_TIMESTAMP function as shown below: CURRENT_TIMESTAMP. The CURRENT_TIMESTAMP function is a SQL-standard function supported by almost all database systems such as DB2, Firebird, Microsoft SQL Server, MySQL, Oracle, PostgreSQL, and SQLite.

How to get day of week in SQL Server?

How to Get First and Last Day of a Week in SQL Server. To get the first or the last day of the week in SQL Server, you can use the following code: SELECT DATEADD (wk, -1, DATEADD (DAY, 1-DATEPART (WEEKDAY, GETDATE ()), DATEDIFF (dd, 0, GETDATE ()))) --first day previous week. SELECT DATEADD (wk, 0, DATEADD (DAY, 1-DATEPART (WEEKDAY, GETDATE ()), DATEDIFF (dd, 0, GETDATE ()))) --first day current week.

What is the date format in SQL Server?

What is date manipulation?

Can you use datetime in SQL Server 2008?

About this website

How do I subtract days from a date in SQL query?

MySQL DATE_SUB() Function
  1. Subtract 10 days from a date and return the date: SELECT DATE_SUB("2017-06-15", INTERVAL 10 DAY);
  2. Subtract 15 minutes from a date and return the date: ...
  3. Subtract 3 hours from a date and return the date: ...
  4. Add 2 months to a date and return the date:
Jun 15, 2017

Can you subtract from a date in SQL?

SQL Server DATEDIFF() Function

The DATEDIFF() function returns the difference between two dates.

How do I count days from a date in SQL?

Use the DATEDIFF() function to retrieve the number of days between two dates in a MySQL database. This function takes two arguments: The end date. (In our example, it's the expiration_date column.)

How do you add or subtract days in SQL?

Using DATEADD Function and Examples
  1. Add 30 days to a date SELECT DATEADD(DD,30,@Date)
  2. Add 3 hours to a date SELECT DATEADD(HOUR,-3,@Date)
  3. Subtract 90 minutes from date SELECT DATEADD(MINUTE,-90,@Date)
  4. Check out the chart to get a list of all options.
Jul 19, 2021

How do you subtract in SQL?

A Minus Query is a query that uses the MINUS operator in SQL to subtract one result set from another result set to evaluate the result set difference. If there is no difference, there is no remaining result set. If there is a difference, the resulting rows will be displayed.

How do I calculate the number of days between two dates in MySQL?

MySQL DATEDIFF() Function

The DATEDIFF() function returns the number of days between two date values.

How do I subtract days from two dates in Excel?

Just subtract one date from the other. For example if cell A2 has an invoice date in it of 1/1/2015 and cell B2 has a date paid of 1/30/2015, then you could enter use the formula =B2-A2 to get the number of days between the two dates, or 29.Feb 19, 2015

How do I change the date format in SQL?

How to get different date formats in SQL Server
  1. Use the SELECT statement with CONVERT function and date format option for the date values needed.
  2. To get YYYY-MM-DD use this T-SQL syntax SELECT CONVERT(varchar, getdate(), 23)
  3. To get MM/DD/YY use this T-SQL syntax SELECT CONVERT(varchar, getdate(), 1)
Apr 22, 2021

How do I get 30 days old data in SQL?

SELECT * FROM product WHERE pdate >= DATEADD(day, -30, getdate()).

How to Add and Subtract Dates from DateTime Using DATEADD() Function in ...

In this article, you will learn how to add and subtract years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds from DateTime in the SQL server. DateTime manipulation is the most common scenario is when we fetching data from the database or storing data in a database. Here, in this article, we will use the SQL server built-in DATEADD() function to add or ...

SQL Server DATEADD() Function - W3Schools

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

How do I subtract two dates in SQL? - FindAnyAnswer.com

How to use the DATEADD() Function and Examples Add 30 days to a date SELECT DATEADD(DD,30,@Date) Add 3 hours to a date SELECT DATEADD(HOUR,-3,@Date) Subtract 90 minutes from date SELECT DATEADD(MINUTE,-90,@Date) Check out the chart to get a list of all options.

Subtract two dates in Microsoft SQL Server - Stack Overflow

I want to subtract 2 dates in MS SQL Server. Example: Current date Last used date '2016-03-30' '2015-02-03' Current date refers to today's date, "Last used date" is a measure.

How to Subtract 30 Days from a Date in T-SQL | LearnSQL.com

Discussion: If you would like to subtract dates or times in SQL Server, use the DATEADD() function. It takes three arguments. The first argument is the date/time unit – in our example, we specify the day unit.. Next is the date or time unit value.In our example, this is -30, because we’re taking 30 days away from the current date.Remember that the minus denotes subtracting the value ...

How to Subtract Days from DateTime in Sql Server?

We can use DATEADD () function like below to Subtract days from DateTime in Sql Server. DATEADD () functions first parameter value can be day or dd or d all will return the same result. Below example shows how we can subtract two days from Current DateTime in Sql Server:

How to Subtract Weeks from DateTime in Sql Server?

We can use DATEADD () function to Subtract weeks to DateTime in Sql Server. DATEADD () functions first parameter value can be week or wk or ww, all will return the same result. Below example shows how we can Subtract two weeks from Current DateTime in Sql Server:

How to Subtract Months from DateTime in Sql Server?

We can use DATEADD () function like below to Subtract Months from DateTime in Sql Server. DATEADD () functions first parameter value can be month or mm or m, all will return the same result. Below example shows how we can Subtract two months from Current DateTime in Sql Server:

How to Subtract Quarters from DateTime in Sql Server?

We can use DATEADD () function like below to Subtract Quarters from DateTime in Sql Server. DATEADD () functions first parameter value can be quarter or qq or q, all will return the same result. Below example shows how we can Subtract two Quarters from Current DateTime in Sql Server:

How to Subtract Years from DateTime in Sql Server?

We can use DATEADD () function like below to Subtract Years from DateTime in Sql Server. DATEADD () functions first parameter value can be year or yyyy or yy, all will return the same result. Below example shows how we can Subtract two Years from Current DateTime in Sql Server:

What is the date format in SQL Server?

Date Formats and Units of Time. A thing to note is that the date format can be any date format that SQL Server recognizes such as: etc... Here are the units of time, the SQL Server versions in which they can be used, and abbreviations that can be used instead of the full unit of time name:

What is date manipulation?

Date manipulation is a common scenario when retrieving or storing data in a SQL Server database. There are several functions that are available and in this tip we look at how to use the DATEADD function.

Can you use datetime in SQL Server 2008?

Yes. Yes. yy, yy yy. The table above reveals that there are some units of time that cannot be used with earlier versions of SQL Server. SQL Server 2008 and later introduced new date/time data types: DATETIME2, TIME, and DATETIMEOFFSET.

What is the date format in SQL Server?

Date Formats and Units of Time. A thing to note is that the date format can be any date format that SQL Server recognizes such as: etc... Here are the units of time, the SQL Server versions in which they can be used, and abbreviations that can be used instead of the full unit of time name:

What is date manipulation?

Date manipulation is a common scenario when retrieving or storing data in a SQL Server database. There are several functions that are available and in this tip we look at how to use the DATEADD function.

Can you use datetime in SQL Server 2008?

Yes. Yes. yy, yy yy. The table above reveals that there are some units of time that cannot be used with earlier versions of SQL Server. SQL Server 2008 and later introduced new date/time data types: DATETIME2, TIME, and DATETIMEOFFSET.

image
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9
8.3.17PHP Version3.14sRequest Duration2MBMemory UsageGET {post}Route
  • warninglog[02:10:23] LOG.warning: Creation of dynamic property Barryvdh\Debugbar\DataFormatter\QueryFormatter:...
  • warninglog[02:10:23] LOG.warning: Creation of dynamic property Barryvdh\Debugbar\DataFormatter\QueryFormatter:...
  • warninglog[02:10:23] LOG.warning: Callables of the form ["Swift_SmtpTransport", "Swift_Transport_EsmtpTranspor...
  • warninglog[02:10:23] LOG.warning: Creation of dynamic property Barryvdh\Debugbar\DataFormatter\SimpleFormatter...
  • warninglog[02:10:23] LOG.warning: Creation of dynamic property Barryvdh\Debugbar\DataFormatter\SimpleFormatter...
  • warninglog[02:10:23] LOG.warning: json_decode(): Passing null to parameter #1 ($json) of type string is deprec...
  • warninglog[02:10:23] LOG.warning: json_decode(): Passing null to parameter #1 ($json) of type string is deprec...
  • Booting (43.27ms)
  • Application (3.1s)
  • 1 x Application (98.61%)
    3.10s
    1 x Booting (1.38%)
    43.27ms
    7 templates were rendered
    • themes.DevBlog.content.post (resources/views/themes/DevBlog/content/post.blade.php)34blade
      Params
      0
      post
      1
      postContent
      2
      author
      3
      updated_at
      4
      bing_rich_snippet_text
      5
      bing_rich_snippet_link
      6
      bing_related_keywords
      7
      google_related_keywords
      8
      bing_news_title
      9
      bing_news_description
      10
      bing_videos
      11
      bing_images
      12
      bing_search_result_title
      13
      bing_search_result_description
      14
      bing_search_result_url
      15
      bing_paa_questions
      16
      bing_paa_answers
      17
      bing_slider_faq_questions
      18
      bing_slider_faq_answers
      19
      bing_pop_faq_questions
      20
      bing_pop_faq_answers
      21
      bing_tab_faq_questions
      22
      bing_tab_faq_answers
      23
      google_faq_questions
      24
      google_faq_answers
      25
      google_rich_snippet
      26
      google_search_result
      27
      indexedArray
      28
      total_images
      29
      total_videos
      30
      settings
      31
      url_current
      32
      menus
      33
      sidebar
    • themes.DevBlog.layouts.master (resources/views/themes/DevBlog/layouts/master.blade.php)41blade
      Params
      0
      __env
      1
      app
      2
      errors
      3
      post
      4
      postContent
      5
      author
      6
      updated_at
      7
      bing_rich_snippet_text
      8
      bing_rich_snippet_link
      9
      bing_related_keywords
      10
      google_related_keywords
      11
      bing_news_title
      12
      bing_news_description
      13
      bing_videos
      14
      bing_images
      15
      bing_search_result_title
      16
      bing_search_result_description
      17
      bing_search_result_url
      18
      bing_paa_questions
      19
      bing_paa_answers
      20
      bing_slider_faq_questions
      21
      bing_slider_faq_answers
      22
      bing_pop_faq_questions
      23
      bing_pop_faq_answers
      24
      bing_tab_faq_questions
      25
      bing_tab_faq_answers
      26
      google_faq_questions
      27
      google_faq_answers
      28
      google_rich_snippet
      29
      google_search_result
      30
      indexedArray
      31
      total_images
      32
      total_videos
      33
      settings
      34
      url_current
      35
      menus
      36
      sidebar
      37
      i
      38
      __currentLoopData
      39
      loop
      40
      item
    • themes.DevBlog.panels.head (resources/views/themes/DevBlog/panels/head.blade.php)41blade
      Params
      0
      __env
      1
      app
      2
      errors
      3
      post
      4
      postContent
      5
      author
      6
      updated_at
      7
      bing_rich_snippet_text
      8
      bing_rich_snippet_link
      9
      bing_related_keywords
      10
      google_related_keywords
      11
      bing_news_title
      12
      bing_news_description
      13
      bing_videos
      14
      bing_images
      15
      bing_search_result_title
      16
      bing_search_result_description
      17
      bing_search_result_url
      18
      bing_paa_questions
      19
      bing_paa_answers
      20
      bing_slider_faq_questions
      21
      bing_slider_faq_answers
      22
      bing_pop_faq_questions
      23
      bing_pop_faq_answers
      24
      bing_tab_faq_questions
      25
      bing_tab_faq_answers
      26
      google_faq_questions
      27
      google_faq_answers
      28
      google_rich_snippet
      29
      google_search_result
      30
      indexedArray
      31
      total_images
      32
      total_videos
      33
      settings
      34
      url_current
      35
      menus
      36
      sidebar
      37
      i
      38
      __currentLoopData
      39
      loop
      40
      item
    • themes.DevBlog.panels.header (resources/views/themes/DevBlog/panels/header.blade.php)41blade
      Params
      0
      __env
      1
      app
      2
      errors
      3
      post
      4
      postContent
      5
      author
      6
      updated_at
      7
      bing_rich_snippet_text
      8
      bing_rich_snippet_link
      9
      bing_related_keywords
      10
      google_related_keywords
      11
      bing_news_title
      12
      bing_news_description
      13
      bing_videos
      14
      bing_images
      15
      bing_search_result_title
      16
      bing_search_result_description
      17
      bing_search_result_url
      18
      bing_paa_questions
      19
      bing_paa_answers
      20
      bing_slider_faq_questions
      21
      bing_slider_faq_answers
      22
      bing_pop_faq_questions
      23
      bing_pop_faq_answers
      24
      bing_tab_faq_questions
      25
      bing_tab_faq_answers
      26
      google_faq_questions
      27
      google_faq_answers
      28
      google_rich_snippet
      29
      google_search_result
      30
      indexedArray
      31
      total_images
      32
      total_videos
      33
      settings
      34
      url_current
      35
      menus
      36
      sidebar
      37
      i
      38
      __currentLoopData
      39
      loop
      40
      item
    • themes.DevBlog.panels.navbar (resources/views/themes/DevBlog/panels/navbar.blade.php)41blade
      Params
      0
      __env
      1
      app
      2
      errors
      3
      post
      4
      postContent
      5
      author
      6
      updated_at
      7
      bing_rich_snippet_text
      8
      bing_rich_snippet_link
      9
      bing_related_keywords
      10
      google_related_keywords
      11
      bing_news_title
      12
      bing_news_description
      13
      bing_videos
      14
      bing_images
      15
      bing_search_result_title
      16
      bing_search_result_description
      17
      bing_search_result_url
      18
      bing_paa_questions
      19
      bing_paa_answers
      20
      bing_slider_faq_questions
      21
      bing_slider_faq_answers
      22
      bing_pop_faq_questions
      23
      bing_pop_faq_answers
      24
      bing_tab_faq_questions
      25
      bing_tab_faq_answers
      26
      google_faq_questions
      27
      google_faq_answers
      28
      google_rich_snippet
      29
      google_search_result
      30
      indexedArray
      31
      total_images
      32
      total_videos
      33
      settings
      34
      url_current
      35
      menus
      36
      sidebar
      37
      i
      38
      __currentLoopData
      39
      loop
      40
      item
    • themes.DevBlog.panels.footer (resources/views/themes/DevBlog/panels/footer.blade.php)41blade
      Params
      0
      __env
      1
      app
      2
      errors
      3
      post
      4
      postContent
      5
      author
      6
      updated_at
      7
      bing_rich_snippet_text
      8
      bing_rich_snippet_link
      9
      bing_related_keywords
      10
      google_related_keywords
      11
      bing_news_title
      12
      bing_news_description
      13
      bing_videos
      14
      bing_images
      15
      bing_search_result_title
      16
      bing_search_result_description
      17
      bing_search_result_url
      18
      bing_paa_questions
      19
      bing_paa_answers
      20
      bing_slider_faq_questions
      21
      bing_slider_faq_answers
      22
      bing_pop_faq_questions
      23
      bing_pop_faq_answers
      24
      bing_tab_faq_questions
      25
      bing_tab_faq_answers
      26
      google_faq_questions
      27
      google_faq_answers
      28
      google_rich_snippet
      29
      google_search_result
      30
      indexedArray
      31
      total_images
      32
      total_videos
      33
      settings
      34
      url_current
      35
      menus
      36
      sidebar
      37
      i
      38
      __currentLoopData
      39
      loop
      40
      item
    • themes.DevBlog.panels.scripts (resources/views/themes/DevBlog/panels/scripts.blade.php)41blade
      Params
      0
      __env
      1
      app
      2
      errors
      3
      post
      4
      postContent
      5
      author
      6
      updated_at
      7
      bing_rich_snippet_text
      8
      bing_rich_snippet_link
      9
      bing_related_keywords
      10
      google_related_keywords
      11
      bing_news_title
      12
      bing_news_description
      13
      bing_videos
      14
      bing_images
      15
      bing_search_result_title
      16
      bing_search_result_description
      17
      bing_search_result_url
      18
      bing_paa_questions
      19
      bing_paa_answers
      20
      bing_slider_faq_questions
      21
      bing_slider_faq_answers
      22
      bing_pop_faq_questions
      23
      bing_pop_faq_answers
      24
      bing_tab_faq_questions
      25
      bing_tab_faq_answers
      26
      google_faq_questions
      27
      google_faq_answers
      28
      google_rich_snippet
      29
      google_search_result
      30
      indexedArray
      31
      total_images
      32
      total_videos
      33
      settings
      34
      url_current
      35
      menus
      36
      sidebar
      37
      i
      38
      __currentLoopData
      39
      loop
      40
      item
    uri
    GET {post}
    middleware
    web, checkdate
    as
    post.show
    controller
    App\Http\Controllers\Frontend\json_data\PostController@show
    namespace
    where
    file
    app/Http/Controllers/Frontend/json_data/PostController.php:18-166
    7 statements were executed3.06s
    • select * from `posts` where `published_at` <= '2025-04-19 02:10:23' and `slug` = 'how-do-i-subtract-days-from-a-date-in-sql' and `posts`.`deleted_at` is null limit 1
      7.76ms/app/Providers/RouteServiceProvider.php:54receivinghelpdeskask
      Metadata
      Bindings
      • 0. 2025-04-19 02:10:23
      • 1. how-do-i-subtract-days-from-a-date-in-sql
      Backtrace
      • 15. /app/Providers/RouteServiceProvider.php:54
      • 18. /vendor/laravel/framework/src/Illuminate/Routing/Router.php:842
      • 19. Route binding:39
      • 20. /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
      • 21. /vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:78
    • select * from `json_post_contents` where `json_post_contents`.`post_id` = 156932 and `json_post_contents`.`post_id` is not null and `rewrite_id` = 0
      44.93msmiddleware::checkdate:30receivinghelpdeskask
      Metadata
      Bindings
      • 0. 156932
      • 1. 0
      Backtrace
      • 19. middleware::checkdate:30
      • 20. /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
      • 21. /vendor/laravel/jetstream/src/Http/Middleware/ShareInertiaData.php:61
      • 22. /vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:167
      • 23. /vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:50
    • select * from `nova_menu_menus` where `slug` = 'header' limit 1
      5.14ms/vendor/outl1ne/nova-menu-builder/src/helpers.php:32receivinghelpdeskask
      Metadata
      Bindings
      • 0. header
      Backtrace
      • 15. /vendor/outl1ne/nova-menu-builder/src/helpers.php:32
      • 17. /vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54
      • 18. /vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45
      • 19. /vendor/laravel/framework/src/Illuminate/Routing/Route.php:261
      • 20. /vendor/laravel/framework/src/Illuminate/Routing/Route.php:205
    • select * from `nova_menu_menu_items` where `nova_menu_menu_items`.`menu_id` = 1 and `nova_menu_menu_items`.`menu_id` is not null and `parent_id` is null order by `parent_id` asc, `order` asc, `name` asc
      8.6ms/vendor/outl1ne/nova-menu-builder/src/Models/Menu.php:35receivinghelpdeskask
      Metadata
      Bindings
      • 0. 1
      Backtrace
      • 19. /vendor/outl1ne/nova-menu-builder/src/Models/Menu.php:35
      • 20. /vendor/outl1ne/nova-menu-builder/src/helpers.php:33
      • 22. /vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54
      • 23. /vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45
      • 24. /vendor/laravel/framework/src/Illuminate/Routing/Route.php:261
    • select * from `nova_menu_menu_items` where `nova_menu_menu_items`.`parent_id` in (1) order by `order` asc
      3.68ms/vendor/outl1ne/nova-menu-builder/src/Models/Menu.php:35receivinghelpdeskask
      Metadata
      Backtrace
      • 24. /vendor/outl1ne/nova-menu-builder/src/Models/Menu.php:35
      • 25. /vendor/outl1ne/nova-menu-builder/src/helpers.php:33
      • 27. /vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54
      • 28. /vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45
      • 29. /vendor/laravel/framework/src/Illuminate/Routing/Route.php:261
    • select `id`, `post_title`, `slug` from `posts` where `status` = 'publish' and `posts`.`deleted_at` is null order by RAND() limit 10
      2.99s/app/View/Composers/SidebarView.php:22receivinghelpdeskask
      Metadata
      Bindings
      • 0. publish
      Backtrace
      • 14. /app/View/Composers/SidebarView.php:22
      • 15. /app/View/Composers/SidebarView.php:12
      • 16. /vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php:124
      • 17. /vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php:162
      • 20. /vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php:177
    • select * from `fake_users` where `fake_users`.`id` = 3864 limit 1
      2.11msview::2dd102cf0462e89a4d4d8bc77355d767652bf9aa:15receivinghelpdeskask
      Metadata
      Bindings
      • 0. 3864
      Backtrace
      • 21. view::2dd102cf0462e89a4d4d8bc77355d767652bf9aa:15
      • 23. /vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:108
      • 24. /vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:58
      • 25. /vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php:69
      • 26. /vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php:61
    App\Models\FakeUser
    1
    Outl1ne\MenuBuilder\Models\MenuItem
    1
    Outl1ne\MenuBuilder\Models\Menu
    1
    App\Models\JsonPostContent
    1
    App\Models\Post
    11
        _token
        rTtnkaTSEVSDIVCPG31WHjPEsiZq0ezXYvBC9fx6
        _previous
        array:1 [ "url" => "https://receivinghelpdesk.com/ask/how-do-i-subtract-days-from-a-date-in-sql" ]
        _flash
        array:2 [ "old" => [] "new" => [] ]
        PHPDEBUGBAR_STACK_DATA
        []
        path_info
        /how-do-i-subtract-days-from-a-date-in-sql
        status_code
        200
        
        status_text
        OK
        format
        html
        content_type
        text/html; charset=UTF-8
        request_query
        []
        
        request_request
        []
        
        request_headers
        0 of 0
        array:24 [ "cf-ipcountry" => array:1 [ 0 => "US" ] "cf-connecting-ip" => array:1 [ 0 => "18.216.229.154" ] "cdn-loop" => array:1 [ 0 => "cloudflare; loops=1" ] "cf-visitor" => array:1 [ 0 => "{"scheme":"https"}" ] "sec-fetch-site" => array:1 [ 0 => "none" ] "accept" => array:1 [ 0 => "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" ] "user-agent" => array:1 [ 0 => "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)" ] "upgrade-insecure-requests" => array:1 [ 0 => "1" ] "sec-ch-ua-platform" => array:1 [ 0 => ""Windows"" ] "sec-ch-ua-mobile" => array:1 [ 0 => "?0" ] "sec-ch-ua" => array:1 [ 0 => ""HeadlessChrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"" ] "cache-control" => array:1 [ 0 => "no-cache" ] "pragma" => array:1 [ 0 => "no-cache" ] "sec-fetch-dest" => array:1 [ 0 => "document" ] "cf-ray" => array:1 [ 0 => "9326fa1b48fafa15-ORD" ] "accept-encoding" => array:1 [ 0 => "gzip, br" ] "priority" => array:1 [ 0 => "u=0, i" ] "sec-fetch-user" => array:1 [ 0 => "?1" ] "sec-fetch-mode" => array:1 [ 0 => "navigate" ] "connection" => array:1 [ 0 => "close" ] "x-forwarded-proto" => array:1 [ 0 => "https" ] "x-forwarded-for" => array:1 [ 0 => "18.216.229.154, 172.70.131.111" ] "x-server-addr" => array:1 [ 0 => "154.12.239.204" ] "host" => array:1 [ 0 => "receivinghelpdesk.com" ] ]
        request_server
        0 of 0
        array:55 [ "USER" => "runcloud" "HOME" => "/home/runcloud" "SCRIPT_NAME" => "/ask/index.php" "REQUEST_URI" => "/ask/how-do-i-subtract-days-from-a-date-in-sql" "QUERY_STRING" => "" "REQUEST_METHOD" => "GET" "SERVER_PROTOCOL" => "HTTP/1.0" "GATEWAY_INTERFACE" => "CGI/1.1" "REDIRECT_URL" => "/ask/how-do-i-subtract-days-from-a-date-in-sql" "REMOTE_PORT" => "60750" "SCRIPT_FILENAME" => "/home/runcloud/webapps/ReceivingHelpDesk/ask/index.php" "SERVER_ADMIN" => "you@example.com" "CONTEXT_DOCUMENT_ROOT" => "/home/runcloud/webapps/ReceivingHelpDesk/" "CONTEXT_PREFIX" => "" "REQUEST_SCHEME" => "http" "DOCUMENT_ROOT" => "/home/runcloud/webapps/ReceivingHelpDesk/" "REMOTE_ADDR" => "172.70.131.111" "SERVER_PORT" => "80" "SERVER_ADDR" => "127.0.0.1" "SERVER_NAME" => "receivinghelpdesk.com" "SERVER_SOFTWARE" => "Apache/2.4.63 (Unix) OpenSSL/1.1.1f" "SERVER_SIGNATURE" => "" "LD_LIBRARY_PATH" => "/RunCloud/Packages/apache2-rc/lib" "PATH" => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" "HTTP_CF_IPCOUNTRY" => "US" "HTTP_CF_CONNECTING_IP" => "18.216.229.154" "HTTP_CDN_LOOP" => "cloudflare; loops=1" "HTTP_CF_VISITOR" => "{"scheme":"https"}" "HTTP_SEC_FETCH_SITE" => "none" "HTTP_ACCEPT" => "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" "HTTP_USER_AGENT" => "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)" "HTTP_UPGRADE_INSECURE_REQUESTS" => "1" "HTTP_SEC_CH_UA_PLATFORM" => ""Windows"" "HTTP_SEC_CH_UA_MOBILE" => "?0" "HTTP_SEC_CH_UA" => ""HeadlessChrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"" "HTTP_CACHE_CONTROL" => "no-cache" "HTTP_PRAGMA" => "no-cache" "HTTP_SEC_FETCH_DEST" => "document" "HTTP_CF_RAY" => "9326fa1b48fafa15-ORD" "HTTP_ACCEPT_ENCODING" => "gzip, br" "HTTP_PRIORITY" => "u=0, i" "HTTP_SEC_FETCH_USER" => "?1" "HTTP_SEC_FETCH_MODE" => "navigate" "HTTP_CONNECTION" => "close" "HTTP_X_FORWARDED_PROTO" => "https" "HTTP_X_FORWARDED_FOR" => "18.216.229.154, 172.70.131.111" "HTTP_X_SERVER_ADDR" => "154.12.239.204" "HTTP_HOST" => "receivinghelpdesk.com" "HTTPS" => "on" "REDIRECT_STATUS" => "200" "REDIRECT_HTTPS" => "on" "FCGI_ROLE" => "RESPONDER" "PHP_SELF" => "/ask/index.php" "REQUEST_TIME_FLOAT" => 1745008823.6725 "REQUEST_TIME" => 1745008823 ]
        request_cookies
        []
        
        response_headers
        0 of 0
        array:7 [ "content-type" => array:1 [ 0 => "text/html; charset=UTF-8" ] "cache-control" => array:1 [ 0 => "private, must-revalidate" ] "date" => array:1 [ 0 => "Fri, 18 Apr 2025 20:40:23 GMT" ] "pragma" => array:1 [ 0 => "no-cache" ] "expires" => array:1 [ 0 => -1 ] "set-cookie" => array:2 [ 0 => "XSRF-TOKEN=eyJpdiI6IktmaEhvUTZzcS9CQ094WnNkK0RJS0E9PSIsInZhbHVlIjoid1p3L3pFYWQvZXpKTmppdWVJTFNpb3I1ZitqRzZTQ1dISVpUYkpXWG9sSVdvZndxREtybmxoM01CdGR4VWFWZWQzemtXVW50cmlIYzVMUU4wQ24wZGZ1N1g4TjUzZE8rMEdLZkE2S2xYaTNrOGRFUlNLaStjS2MydTN2eEI3c1giLCJtYWMiOiIyYjE1OGI3MmI1MDQ0MWYzMzk5MWIzMzE2YWM3NTAzMGIzOWQ3Zjg5OTRmZDQ4ZTIyNTcyMTk3ZGFjN2EzMzJkIiwidGFnIjoiIn0%3D; expires=Fri, 18-Apr-2025 22:40:26 GMT; Max-Age=7200; path=/; samesite=laxXSRF-TOKEN=eyJpdiI6IktmaEhvUTZzcS9CQ094WnNkK0RJS0E9PSIsInZhbHVlIjoid1p3L3pFYWQvZXpKTmppdWVJTFNpb3I1ZitqRzZTQ1dISVpUYkpXWG9sSVdvZndxREtybmxoM01CdGR4VWFWZWQzemtXV" 1 => "askhelpdesk_session=eyJpdiI6Ilpqdk8zYXpvSWJrUzYrWGVOQlZXK2c9PSIsInZhbHVlIjoiWG5qVE5yclJydlhRWnUxUFVUcGdodVhMN1ltRlJQTmJwdmZRbWpBaFJWMDZEaTZiL0N2ZFBKc2dLZ1BkbkdDRXFreWNIZi92NUl3WENkUUlrR0dVUDgrZWNRU081MTdHTy96YVpkTUxTbkZTWFFXeGwzTXZKUzJFUjBUclI5bVMiLCJtYWMiOiJhYTU4OGFjMWY4ZmVlMGNlN2QxYzIyMDBiNzA2OWVlODZlNDU3N2YzZGJiMDMzNTc0MDc5YjZiZjA2MWIzYjQxIiwidGFnIjoiIn0%3D; expires=Fri, 18-Apr-2025 22:40:26 GMT; Max-Age=7200; path=/; httponly; samesite=laxaskhelpdesk_session=eyJpdiI6Ilpqdk8zYXpvSWJrUzYrWGVOQlZXK2c9PSIsInZhbHVlIjoiWG5qVE5yclJydlhRWnUxUFVUcGdodVhMN1ltRlJQTmJwdmZRbWpBaFJWMDZEaTZiL0N2ZFBKc2dLZ1BkbkdD" ] "Set-Cookie" => array:2 [ 0 => "XSRF-TOKEN=eyJpdiI6IktmaEhvUTZzcS9CQ094WnNkK0RJS0E9PSIsInZhbHVlIjoid1p3L3pFYWQvZXpKTmppdWVJTFNpb3I1ZitqRzZTQ1dISVpUYkpXWG9sSVdvZndxREtybmxoM01CdGR4VWFWZWQzemtXVW50cmlIYzVMUU4wQ24wZGZ1N1g4TjUzZE8rMEdLZkE2S2xYaTNrOGRFUlNLaStjS2MydTN2eEI3c1giLCJtYWMiOiIyYjE1OGI3MmI1MDQ0MWYzMzk5MWIzMzE2YWM3NTAzMGIzOWQ3Zjg5OTRmZDQ4ZTIyNTcyMTk3ZGFjN2EzMzJkIiwidGFnIjoiIn0%3D; expires=Fri, 18-Apr-2025 22:40:26 GMT; path=/XSRF-TOKEN=eyJpdiI6IktmaEhvUTZzcS9CQ094WnNkK0RJS0E9PSIsInZhbHVlIjoid1p3L3pFYWQvZXpKTmppdWVJTFNpb3I1ZitqRzZTQ1dISVpUYkpXWG9sSVdvZndxREtybmxoM01CdGR4VWFWZWQzemtXV" 1 => "askhelpdesk_session=eyJpdiI6Ilpqdk8zYXpvSWJrUzYrWGVOQlZXK2c9PSIsInZhbHVlIjoiWG5qVE5yclJydlhRWnUxUFVUcGdodVhMN1ltRlJQTmJwdmZRbWpBaFJWMDZEaTZiL0N2ZFBKc2dLZ1BkbkdDRXFreWNIZi92NUl3WENkUUlrR0dVUDgrZWNRU081MTdHTy96YVpkTUxTbkZTWFFXeGwzTXZKUzJFUjBUclI5bVMiLCJtYWMiOiJhYTU4OGFjMWY4ZmVlMGNlN2QxYzIyMDBiNzA2OWVlODZlNDU3N2YzZGJiMDMzNTc0MDc5YjZiZjA2MWIzYjQxIiwidGFnIjoiIn0%3D; expires=Fri, 18-Apr-2025 22:40:26 GMT; path=/; httponlyaskhelpdesk_session=eyJpdiI6Ilpqdk8zYXpvSWJrUzYrWGVOQlZXK2c9PSIsInZhbHVlIjoiWG5qVE5yclJydlhRWnUxUFVUcGdodVhMN1ltRlJQTmJwdmZRbWpBaFJWMDZEaTZiL0N2ZFBKc2dLZ1BkbkdD" ] ]
        session_attributes
        0 of 0
        array:4 [ "_token" => "rTtnkaTSEVSDIVCPG31WHjPEsiZq0ezXYvBC9fx6" "_previous" => array:1 [ "url" => "https://receivinghelpdesk.com/ask/how-do-i-subtract-days-from-a-date-in-sql" ] "_flash" => array:2 [ "old" => [] "new" => [] ] "PHPDEBUGBAR_STACK_DATA" => [] ]