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

Need help in converting numerical value to text (IP address). FM database has an ODBC connection to an external data source. IP address field in the external data source is a numercial equivalent to the decimal value calculation of an IP address.

Edited by Guest

I know I have done this before, just can't figure out where. Hm...

Anyway, try:

Let ( [

B = Mod ( SerialIP ; 256 ) ;

G = Div ( Mod ( SerialIP ; 256^2 ) ; 256 ) ;

R = Div ( Mod ( SerialIP ; 256^3 ) ; 256^2 ) ;

W = Div ( Mod ( SerialIP ; 256^4 ) ; 256^3 )

] ;

W & "." & R & "." & G & "." & B

)

  • Author

Thanks!! I'll give it a try.

  • Author

comment - it worked! although it's missing the 3rd and 4th octet's decimal points

  • Author

comment - nevermind my last entry. I was setting the field to use number instead of text. It's working now!! Thank you so much!

I know I have done this before

Thanks to LaRetta who found it:

http://fmforums.com/forum/showpost.php?post/214528/

Keywords for next time: IPv4 address extract octet RGB()

  • Author

sorry one last question: i have the ip address field but it appears because it is a calculation, i am not able to setup a relationship to a separte table in order to do a lookup based on the same ip address.

I'm afraid I don't follow your setup. In general, you cannot base a relationship on an UNSTORED calculation in the 'child' table. If your calculation is referencing fields from another table, then it must be unstored.

The solution is probably to make an inverse calculation in the 'parent' table - but we need more specific details regarding your tables and relationships.

  • Author

Thank you. I just learned the hard way regarding calcuations. Hopefully I can explain things:

The calculation field was created from an external data source. Is there a way to send the calculation results (decimal number to IP address) as a text field in the same table so that i can reference the result? The only options in the layout is to create calculation or summary fields. Or is there another way?

I'm afraid you will have to be a lot more specific than that. What do you mean by "The calculation field was created from an external data source"? Created where - in another table? How is that table related to the external data source? What needs to be looked up from where? And so on.

  • Author

I appreciate your patience and the quick posts.

Yes the calculation field is one table but is from an ODBC connection. I would like to create a relationship with another table where i manually entered IP addresses (as text) into. this table would lookup description, etc from the ODBC connected table.

Do you mean the calculation is a 'supplemental field' in the ODBC table?

  • Author

yes. is there a way to send the results to a text field in another table or a way to reference the result in a relationship?

I don't understand what you mean by "send the results to a text field in another table", or how this would help. If you calculate the result for ANY record in the ODBC table, how are you going to pick the record from which to send - and more importantly, how will you get back to the same record?

I believe you have two options here: either import the data from the ODBC table into a Filemaker table, then do the calculation there. This will enable the calculation field to be stored, so you will be able to use it to establish a relationship and ultimately do a lookup.

The second option is to do an inverse calculation in the other table and base the relationship on matching the result directly to the decimal IP in the ODBC source.

  • Author

I'm starting to do option#1. However, I'm getting an ODBC error: Query was empty.

I created a new Table with the same fields as the ODBC source. I created a button for the import script step.

Go to Layout (NEW TABLE)

Import Records [No dialog; DSN; Add;Windows ANSI]

  • Author

wow please disregard my last. i think i may have gotten it. thanks for your help!!

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.