Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I have another ESQL statement that I am having trouble getting to work.  I put this together based on a few references, but I could just have something simple misplaced (I hope).

 

What I am trying to achieve: 

I have two tables, A & B, that are related via A::ID = B::A_ID_FK.  It is 1-to-many (A to B ).  I am trying to find a range of records in B that match a given Start/End dates, and then show those IDs along with the "Type" field from Table A.

ExecuteSQL (
    "SELECT A.Type, B.A_ID_FK,
     FROM A, B
     WHERE A.ID = B.A_ID_FK
        AND B.Date > ?
        AND B.Date < ? "
; "|" ; "" ; $Date_Start ; $Date_End )

Any pointers on this woud be appreciated, either in syntax problems or perhaps other ways of getting the result.

 

Another goal is to achieve this with little-to-no architecture added to the solution for this report, so that's why I would like to stick with using ESQL and scripts.  Ultimately this will pull and show data from a variety of different tables, so that's another reason; also trying to use my first Virtual List technique to do this.  So another part of it is the learning experience.  :)

 

 

Thanks,

-- J

Solved by Justin Close

Go to solution

Maybe...

SELECT A.Type, B.A_ID_FK,
   FROM A
   INNER JOIN B ON A.ID = B.A_ID_FK
   WHERE 
     B.Date > ?
     AND B.Date < ?
  • Author
  • Solution

Holy dingleberries.  It looks like I had an extra comma in my original statement, the one at the end of the SELECT line. 

 

I removed it and the format I posted above worked fine.  Woe is me.

 

I tried what you suggested, Tom, and that also worked.  Might be worth evaluating which form is faster. 

 

Thanks,

-- J

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.