March 6, 200421 yr Newbies I have a numeric field (theDay) that is displayed as Check Boxes with a Value List containing the numbers 1 to 31 that represents the days of a month. I would like to find out if the day from a date field (theDate) has been checked in theDay field. I cannot use PatternCount(theDay,day(theDate)) because if the day is 1 then a match will be made on any day with a 1 in it such as 1, 10...19, 21, 31. e.g. [ ] 1 [x] 2 [ ] 3 ...... would match with 2/3/2004 [ ] 11 ..... [x] 21 ..... would not match with 2/3/2004
March 6, 200421 yr This will tell you what the day# of the date is: MiddleWords( DateToText(Date_), 2, 1) Appears to work no matter how the date is "formatted" to look on the layout.
March 6, 200421 yr Author Newbies Fenton, Thanks for the reply. I can get the Day# by using the day() function as shown above in my first post. My problem is related to how data is stored in a field that is filled using the checkbox/valuelist method. The following examples show what I mean: "SatMonTue" This string was imported from a checkbox/valuelist field that has days of week. "102322" This string is the one I am interested. It comes from another checkbox/valuelist field with the values 10,23,22 selected. Using the day() function I can extract the day from the date. So for 2/3/2004 I get the value 2 for the day. I now want to see if 2 (which is the day from the above date) appears in the string "102322" without detecting the 2 in 23 and 22. So in this example there should be no match. Hope this explains my problem a little better. premier
March 6, 200421 yr You may format it as text rather than num. Then the values would be separated by a Carriage Return, and it should be easy then to compare the value of gMatch (a global) with your DaysNumber field. Patterncount("
Create an account or sign in to comment