dbTalk Databases Forums  

Calculation Field Help

comp.databases.filemaker comp.databases.filemaker


Discuss Calculation Field Help in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Henry
 
Posts: n/a

Default Calculation Field Help - 08-04-2003 , 05:19 PM






I have a calculation field that is suppose to search for a string within a
field, and assign a value if it finds it, otherwise assign another value.

CMycalField =
If (AdOrder = "*trk*", 2, 1)

Where the result is a number.
I was hoping to find the letters "trk" somewhere in the field and if found
assign 2 to CMycalField, if not assign 1. It assigns everything 1.

Can someone help clarify this for me

Thanks


Reply With Quote
  #2  
Old   
Lynn allen
 
Posts: n/a

Default Re: Calculation Field Help - 08-04-2003 , 05:29 PM






Henry <henry_filemaker (AT) hotmail (DOT) com> wrote:

Quote:
I have a calculation field that is suppose to search for a string within a
field, and assign a value if it finds it, otherwise assign another value.

CMycalField =
If (AdOrder = "*trk*", 2, 1)

Where the result is a number.
I was hoping to find the letters "trk" somewhere in the field and if found
assign 2 to CMycalField, if not assign 1. It assigns everything 1.

Can someone help clarify this for me
If(Patterncount(Fieldname, "trk") = 1, 2, 1)


--
Lynn Allen Allen & Allen Semiotics
FSA Associate Filemaker Consulting & Training
lynn (AT) semiotics (DOT) com http://www.semiotics.com


Reply With Quote
  #3  
Old   
Henk B
 
Posts: n/a

Default Re: Calculation Field Help - 08-04-2003 , 05:48 PM



Lynn allen <lynn (AT) NOT-semiotics (DOT) com> wrote:

Quote:
Henry <henry_filemaker (AT) hotmail (DOT) com> wrote:

I have a calculation field that is suppose to search for a string within a
field, and assign a value if it finds it, otherwise assign another value.

CMycalField =
If (AdOrder = "*trk*", 2, 1)

Where the result is a number.
I was hoping to find the letters "trk" somewhere in the field and if found
assign 2 to CMycalField, if not assign 1. It assigns everything 1.

Can someone help clarify this for me

If(Patterncount(Fieldname, "trk") = 1, 2, 1)
What if there are multiple occurrences of the string "trk"?
If(PatternCount(Fieldname, "trk"), 2, 1)

--
Henk B


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.