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.
Juggernaut

using a calculation that references text and dat

Featured Replies

i am using a calculation to set a field with text. i use the match of this text to another relational database (this is all in fm pro 6, unfortunately) to create a relational value list. up until now, the relation has been based on text. now i need it to calculate a text field as well as if it is after a certain date. and i am not getting the right results. here it is:

If(Left(Customer ID, 5) = "Enron","Enron",

If(Customer ID = "TS&S Employee","Employee",

If(Customer ID = "TS&S General","General",

If(Customer ID = "Tower Automotive","Tower",

If(Customer ID = "Saint Vincents","St. Vincents",

If(Customer ID = "Delphi Corporation" and

Slip Date > 8/31/2006,"Delphi",

"Other"))))))

now, slip date is a date field and this calculation returns text. i have tried using texttodate and datetotext to define the contents of slip date. what i don't get is, if i search on slips greater than 8/31/06 it brings the right result, but the calculation produces some wierd stuff. i find this baffling. any ideas or inspirational words of wisdom would be greatly appreciated before i throw myself out the window :)

Limore

ps i know this calc is pretty ugly looking. try to overlook that aspect of it. thanks. :

  • Author

i fixed this myself. finally

If(Left(Customer ID, 5) = "Enron","Enron",

If(Customer ID = "TS&S Employee","Employee",

If(Customer ID = "TS&S General","General",

If(Customer ID = "Tower Automotive","Tower",

If(Customer ID = "Saint Vincents","St. Vincents",

If(Customer ID = "Delphi Corporation" and

Slip Date ≥ Date(9, 1, 2006),"Delphi",

"Other"))))))

You should have been able to use the TextToDate() function, but you would have to enclose the date in quotes like this:

...Slip Date ≥ TextToDate("8/31/2006"),"Delphi"...

Also, if you use the Case() function you can get rid of all the nested If() functions, which will make it more readable.

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.