If String Contains?

GendoPose

Registered User.
Local time
Today, 02:42
Joined
Nov 18, 2013
Messages
175
Hi All,

In my query, I have the week number and year arranged like this - "Y14-W11"

I want to return a value in a text box on a report if the string contains, for example, W11. In this textbox I've put the expression

Code:
=IIf([Y##-W##]="*" & "W11" & "*","2100000","BLAH")

But this just returns the falsepart no matter if the string contains W11 or not.

Any ideas?
 
How about,
Code:
IIF([URL="http://www.techonthenet.com/access/functions/string/instr.php"]InStr[/URL]([yourFieldName], "W11") <> 0, "2100000", "BLAH")
 
When you have the ability to use a Date/Time data type, and intrinsic functions to get the Year() or Weeknumber from that Date data type, why would you create your own customized structure and format?
see this for week
 
How about,
Code:
IIF([URL="http://www.techonthenet.com/access/functions/string/instr.php"]InStr[/URL]([yourFieldName], "W11") <> 0, "2100000", "BLAH")

Yeah that's got it, thank you very much!

When you have the ability to use a Date/Time data type, and intrinsic functions to get the Year() or Weeknumber from that Date data type, why would you create your own customized structure and format?
see this for week

Mainly because the data spans across several years and the built in function for a weeknumber only gives you that so when having to work with data that goes across that length of time, I wanted something a little more specific and also something I could sort by.
 

Users who are viewing this thread

Back
Top Bottom