From: Prohock on 19 Dec 2009 02:36 Simple question! I have a table that has a single field called [name]. I want my report to display true if a name matches "bill". For exam if the field value is "bill Jan" or "Jan Bill" it would be true, "Jan Mark" would be false. Something like this: =IIf([Name] Like "&bill&","true","false")
From: Allen Browne on 19 Dec 2009 06:10 Use * as the wildcard, so: =IIf([YourFieldNameHere] Like "*bill*", "Yep", "Nah") There is a serious problem with the field named Name. Most things in Access (including reports) have a Name property, so Access is likely to mistake your example and use the Name of the report instead of the contents of the field named Name. Rename the field to CustomerName or somthing. Before you do that, turn Name AutoCorrect off. Otherwise Access remembers and still tries to match the original field name. More info on why you want this off: http://allenbrowne.com/bug-03.html -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Prohock" <Prohock(a)discussions.microsoft.com> wrote in message news:9E4CF9D8-D4EE-4ABE-8DB4-C44C5D157BCA(a)microsoft.com... > Simple question! I have a table that has a single field called [name]. I > want > my report to display true if a name matches "bill". For exam if the field > value is "bill Jan" or "Jan Bill" it would be true, "Jan Mark" would be > false. Something like this: > > =IIf([Name] Like "&bill&","true","false")
|
Pages: 1 Prev: Sum the values between start and end date Next: data type mismatch |