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.

Show machines not active in a many-to-many relationship

Featured Replies

  • Newbies

Hi,

I have a portal that needs to display machines not active on any maintenance plan in a many-to-many relationship. The tables are (I did not include all fields, as they are not needed):

tblMachines:

MachineID

Serialnumber

ProductID

....

tblMaintenanceContract:

MaintenanceContractID

Active

EndDate

....

tblMachinesMaintenanceContract:

Identifier

MachineID

MaintenanceContractID

Active

....

tblMaintenanceContract can hold many machines from tblMachines. A machine can only be active on 1 maintenance contract on any given time. A maintenance contract that are not active can not hold any active machines.

In the portal I need to show the machine list of machines that are not active on any maintenance contracts.

To the purpose I created the following SQLstring:

SELECT MachineID FROM tblMachines

LEFT JOIN tblMachinesMaintenanceContract ON tblMachines.MachineID=tblMachinesMaintenanceContract.MachineID

WHERE Active='No' AND tblMachines.MachineID NOT IN (SELECT MachineID FROM tblMachines LEFT JOIN tblMachinesMaintenanceContract ON tblMachines.MachineID=tblMachinesMaintenanceContract.MachineID WHERE Active='Yes')

I know for a fact that above SQLstring will display the correct results (testet with SQLBuilder).

I am then trying to use the SQLstring in the filter of portal records but the result is ... nothing.... How can I get the portal to show the results?

Thanks!

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.