How can I delete record based on date?

Random

I have a set of data with DateTime type in SQL. I want to delete whatever data belong to a specific date for ex: 2021-11-02 21:07:52.663. if I have value like above I want to delete records using just date. 2021-11-02.

HardCode

This will compare the date part of your datetime to the desired date:

DELETE
FROM
    MyTable mt
WHERE
    CAST(mt.MyDate AS DATE) = '2021-11-02'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How I can Delete Record from Firebase?

How can I find a record based on another record?

How can i delete "Zero" in date format?

How I Can delete all record from child table in room?

How can I delete record from table in Oracle?

In mongodb how can i delete a validationed collection document field/record

How can I get the lastest Date for each record?

How can I copy a range to a different sheet based on checkbox value, then delete on the new sheet, while keeping both check boxes up to date

I can not delete a date in sqlite

How to delete record where date is too close?

How can I delete a record (that is selected by mouse) from a datasheet using a Delete button On Click Event?

How can I delete rows for a particular Date in a Pandas dataframe?

In SQL, how can I delete duplicate rows based on multiple columns?

How can I delete files based on (flac) metadata?

how can i delete a hash based on multiple values

How can I delete a sequence of rows based on a condition?

How can I delete rows in R based on frequencies?

How to delete the record based on last character of previous record in a file

How To Update The Date Based On Previous Record Value

How can I change a directory based on the current date in R?

How can I create a Pandas column based on another column with a date?

How can I create a script which triggers an email based on a date?

How can I reorder specific columns based on their date values?

How can I write a C #if directive that branches based on the current date

MySQL, how can I select row based on the specific date?

How can I get the minimum date based on a condition in Resdhift?

How can I UPDATE a date based on a cell change in Excel?

How can I partition data based on DATE Ranges in SQL Server

MYSQL How can I sum based on multiple criteria by date and by response