[Solved] I am trying to weed my database to remove data according to criteria.
I am trying to use the command panel accessed from the front panel Tools/SQL. When I used DELETE FROM with a criterion <H0001 then it worked.
I could not make it work when the criterion was < a date even when I enclosed the date in #s
[Solved] DELETE function in SQL command syntax
[Solved] DELETE function in SQL command syntax
Last edited by JimNH14 on Tue May 29, 2018 11:29 am, edited 1 time in total.
JimNH
OpenOffice 4.01 on
Windows 10
OpenOffice 4.01 on
Windows 10
Re: DELETE function in SQL command syntax
Below is an example of a DELETE statement.
Please note:
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
Please note:
- You will have to change "MY_TABLE" to the name of your table
- You will have to change "MY_DATE_COLUMN" to the name of the column in your table
- You will have to change the sample date to a date in YYYY-MM-DD format, surrounded by single quotes. Additional note, it is important that the YEAR is a four digit year. So, change '2014-07-15' to the particular date you desire. '2014-07-15' is Year: 2014, Month: the 7th month of the year, and Day: the 15th day of the month.
- In the statement below, it is using a < ( less than ) operation, you could modify it to use:
- <= ( less than or equal to )
- = ( equal to )
- > ( greater than )
- >=( greater than or equal to )
Code: Select all
DELETE FROM "MY_TABLE" WHERE "MY_DATE_COLUMN" < '2014-07-15'
Sliderule
Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
Re: DELETE function in SQL command syntax
Thank you for your quick response.
It has worked. I had forgotten the syntax - thanks again
JimNH
It has worked. I had forgotten the syntax - thanks again
JimNH
JimNH
OpenOffice 4.01 on
Windows 10
OpenOffice 4.01 on
Windows 10