# Usage examples

Please note

Queries may vary depending on the database system. So you may have to make adjustments to the following examples.

# Show documents added to the repository in the last 30 days

Enter the following SQL query to the extra text field of the folder that you want to configure as a dynamic folder.

!+ WHERE objtype>=254 AND objstatus=0 AND DATEADD(mi, objidate, '18991230') >= DATEADD(day, -30, SYSUTCDATETIME())

The individual components of the query:

  • objtype>=254: Restricts the query to documents
  • objstatus=0: Restricts the query to documents that are not deleted
  • DATEADD(mi, objidate, '18991230'): Searches for the filing date (objidate) in minutes (mi) since the reference date (December 30, 1899).

Information

The ISO date was selected here to avoid possible conversion problems. In English-language installations, MM/DD/YYYY usually works as well.

  • >=: The operators restrict the search to documents with a filing date later than or equal to the current date minus 30 days.
  • DATEADD(day, -30, SYSUTCDATETIME()): Here the system date is read out in UTC format (SYSUTCDATETIME()) in days (day). 30 days are then subtracted from that.

Information

The SYSUTCDATETIME function was not available until SQL Server 2005. If you are using an earlier version of the software, use the function GETDATE().

# Other usage examples

Task Entry to Extra text tab
All documents that use the Basic Entry metadata form. The list of results is sorted in descending order (DESC) by the document date (objxdate). !+ WHERE objmask=0 AND objtype>=254 AND objstatus=0 ORDER BY objxdate DESC
All folders with the Basic Entry metadata form, sorted descending by document date !+ WHERE objmask=0 AND objtype<254 AND objstatus=0 ORDER BY objxdate DESC
All objects with a specific color (objkind) !+ WHERE objkind = 12 ORDER BY objxdate DESC
Documents with a specific document path with a filing date within a specific time frame A-B (in minutes since December 30, 1899). !+ WHERE objpath =3 AND objidate BETWEEN 60587305 AND 60587308
All objects with "invoice" in the short name !+ WHERE objshort LIKE '%invoice%'
All documents with "ELO" and "xc" in the short name (sorted descending by filing date) !+ WHERE objtype>=254 AND objshort LIKE '%ELO%' AND objshort LIKE '%xc%' AND objstatus=0 ORDER BY objidate DESC
Warning: All objects with access by "Everyone" – this dynamic folder should ideally always be empty. !+ WHERE objacl='75PYJA' AND objstatus=0
Show all checked out/locked folders and documents (sorted by editor) !+ WHERE (objlock <> - 1) ORDER BY objuser
Search the entire contents of the chaos folder in ELO, e. g. you can add the contents of the chaos folder to a search view and transfer the documents to the repository. !+ WHERE objparent = 0
Last updated: August 12, 2024 at 12:49 PM