About 224,000 results
Open links in new tab
  1. SQL Server CAST () Function - W3Schools

    Aug 25, 2017 · Definition and Usage The CAST () function converts a value (of any type) into a specified datatype. Tip: Also look at the CONVERT () function. Syntax CAST (expression AS datatype (length))

  2. CAST and CONVERT (Transact-SQL) - SQL Server | Microsoft Learn

    This example displays a date and time as character data, uses CAST to change the character data to the datetime data type, and then uses CONVERT to change the character data to the datetime data …

  3. SQL Convert String to Date Functions: CAST() and TO_DATE()

    This tutorial shows you how to use the CAST () and TO_DATE () to convert a string to a date in SQL.

  4. SQL Query to Convert DateTime to Date in SQL Server

    Jul 23, 2025 · In this article, we will explain how to convert DateTime to Date in SQL Server using four powerful methods: CAST (), CONVERT (), TRY_CONVERT (), and SUBSTRING ().

  5. When to Use CONVERT () vs CAST () for Date Formatting in SQL Server

    Aug 6, 2025 · When formatting dates in SQL Server you may be wondering whether to use CONVERT() or CAST(). After all, both functions allow us to convert between data types. Let’s take a look at at …

  6. SQL cast as date

    When dealing with dates, it’s common to use the CAST function to convert a string or another compatible data type to the DATE data type. The CAST function allows you to explicitly specify the …

  7. How to Convert VARCHAR to Date in SQL Server

    Jul 24, 2025 · In this comprehensive article, I’ll walk you through everything you need to know about converting VARCHAR to DATE in SQL Server with real-time examples.

  8. CAST(DATETIME AS DATE) over WHERE clause - Stack Overflow

    Jul 9, 2014 · If you have performance concerns and want to force it to use an index, I would suggest adding a column that is of type date (fill it with the existing column's value minus the time part), and …

  9. SQL CAST Function for Data Type Conversions

    May 25, 2021 · In this tutorial, we will examine how to use the CAST operator to update your table columns to accommodate changes brought on by new technology and the ever-changing …

  10. SQL CAST() Function: An Overview - LearnSQL.com

    Dec 3, 2024 · The SQL CAST () function converts one data type to another. Read on to find out how and why you’d use it in your queries.