You can use the following SQL commands to delete terms that were added to a Termbase before or after a particular date and time, or even terms that were added between two different dates.
How to use SQL commands on a Termbase
Running the commands
This article explains how to run an SQL command on a Termbase within DVX3. Make sure that your repair the Termbase after running these commands, to ensure that it is in a consistent state.
Adapting the commands for your own use
You will need to modify the example commands shown in this article for your own use, by modifying the dates and times used. The dates and times are shown in this format: YYYY-MM-DD hh:mm:ss
Where:
- YYYY stands for the year, e.g.: 2012
- MM stands for the month, e.g.: February would be 02
- DD stands for the day of the month, e.g.: 11
- hh stands for the hour, in 24 hour format, e.g.: 5 o'clock on the evening would be 17
- mm stands for the minutes, e.g.: 30
- ss stands for the seconds, e.g.: 30
Thus, 5:30 PM of February 11th, 2012, would be written like this: 2012-02-11 17:30:00
You don't need to specify the time of the day if you don't want to. For example, you can write 2012-02-11 to specify February 11th, 2012.
Commands to delete terms based on the time and date when they were added
To delete terms added after a specific date and time
The following example will delete terms that were added to the Termbase on or after February 11th, 2012, at 5 minutes to 3 o'clock in the afternoon:
DELETE FROM Lemmas WHERE ID IN (SELECT OrgLemmaID FROM Relations WHERE DateStamp >= CDate('2012-02-11 14:55:00'))
To delete terms added after a specific date and time
The following example will delete terms that were added to the Termbase before February 11th, 2012, at 3 o'clock in the afternoon:
DELETE FROM Lemmas WHERE ID IN (SELECT OrgLemmaID FROM Relations WHERE DateStamp < CDate('2012-02-11 15:00:00'))
To delete terms added after a specific date and time
The following example will delete terms that were added to the Termbase on or after February 11th, 2012, at 14:55, but before 15:00 on the same day:
DELETE FROM Lemmas WHERE ID IN (SELECT OrgLemmaID FROM Relations WHERE DateStamp >= CDate('2012-02-11 14:55:00') AND DateStamp < CDate('2012-02-11 15:00:00'))
Comments