How can I remove the time with the date of the database in the data retrieval

Javier R 211 Reputation points
2021-05-06T20:20:40.657+00:00

How can I remove the time with the date on a datePicker on sql server c #. Example ddMMYYY 00:00:00

Universal Windows Platform (UWP)
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,808 questions
0 comments No comments
{count} votes

5 additional answers

Sort by: Most helpful
  1. Guoxiong 8,126 Reputation points
    2021-05-06T21:35:24.747+00:00

    Try to use Format function:

    SELECT FORMAT(GETDATE(), 'ddMMyyyy');
    

  2. Yitzhak Khabinsky 25,116 Reputation points
    2021-05-06T21:44:44.31+00:00

    Another way is via CASTing:

     SELECT CAST(GETDATE() AS DATE);
    
    0 comments No comments

  3. Olaf Helper 41,001 Reputation points
    2021-05-07T05:37:27.04+00:00

    on a datePicker on sql server

    There is not DatePicker or any other control on SQL Server side.

    Use DateTime.Date Property to get the date without time potion.

    0 comments No comments

  4. Viorel 112.5K Reputation points
    2021-05-07T07:29:10.847+00:00

    If you never need the time, then use a date column instead of datetime in SQL.