Avatar 🚀

Pixelchef.net

Blog of Ben Northway, Splunk and Cybersecurity Consultant

  1. Contact
  2. Splunk Consulting
  3. Amelia: Configuration Explorer for Splunk
  4. Photography
  5. QR Code Generator
    1. Dark Mode

SQL Convert datetime to just a date

Nov 08, 2010

Here is how to use the SQL convert function to extract just the date portion of a SQL datetime field.

convert(varchar(10), eventdate, 101)

It will result in something like this:

04/20/2010

You can change the syntax slightly if you want a different date format. Here is the full documentation on the convert function: http://msdn.microsoft.com/en-us/library/aa226054%28SQL.80%29.aspx

SQL

Related content

How to create a simple string filter in SSRS

How to rename a report in SSRS (SQL Server Reporting Services)

Describe table in SQL Server 2005 - Equivalent of Oracle Describe command

You receive "Cannot create a connection to data source" when opening a report on SQL Server Reporting Services

Error 401 Accessing the Report Website

© 2024 Pixelchef.net