Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

The advanced find allows you to create custom finds. 

...

  1. Click the Find button in the toolbar.

  2. Click the Advanced tab.

  3. Click the Query Builder button in the toolbar. 

    div

    Image Modified

  4. Enter your query.

  5. Click OK.
  6. Click Exec button in the toolbar or the Exec button on the right in the Find window. 

    div

    Image Modified

Advanced Functions

Advanced functions allow you to filter results and/or get user input to add to you find.

...

Paste code macro
SELECT dbo.localizedate (DateTime, 'Zip code');

Change DateTime to the datetime needing to be localized, and ZipCode to the zip code to use to determine the timezone for localizing the datetime value. Using the statement above will result in a YY-MM-DD hh:mm:ss.s. For example, the date output would be 2020-09-04 17:17:20.887.

...

  • If you are modifying a query create a backup copy. 

  • Add a header, or snippet, to note the creator, creation date, changelog, and other useful information.

  • Use WITH(NOLOCK) to avoid locking. 

  • See W3Schools' SQL Tutorial more references on SQL. 

  • If you are creating more advanced scripts you can send them to Technical Support for code review.

Use a static variable instead of indeterminant functions in WHERE clause. 

Expand
titleExample of using a static variable instead of indeterminant function.

If you want to get the order ID and current timestamp of all the orders that will be ready in the future, you should use a determinant, instead of using dbo.GetCXTDate() which is an indeterminant function where the value would change every millisecond.

Paste code macro
DECLARE @MyDate DATETIME=dbo.GetCXTDate()
SELECT OrderID, @MyDate
FROM tblOrder
WHERE ReadyTimeFrom>@MyDate

If you want to get the order ID and yesterday’s date of all the orders that were or will be ready starting yesterday, you should use a determinant.

Paste code macro
DECLARE @MyDate DATETIME=DATEADD(DAY,-1,dbo.GetCXTDate())
SELECT OrderID, @MyDate
FROM tblOrder
WHERE ReadyTimeFrom>@MyDate



Ignore Max Records Restrictions

...