Results 1 to 4 of 4
  1. #1
    Creanstar is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2014
    Posts
    1

    Looking for formula to identify where a field begins D followed by two numbers

    Hi,



    I am struggling with a formula to tell me a field is true when it begins with D followed by two numbers - can anyone help?

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Till someone comes along, check out LEFT(), MID(), IIF(), ISNUMERIC(),

    Thanks

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I would use VBA to assign the value to a string variable. With that, you can evaluate the string using InStr() and some of the functions listed in post #2.

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Try something like this:

    Assume you have copied the data to a variable called str, for simplicity, and you have a boolean variable called IsValid:

    IsValid = left(str,1) = "D" AND isnumeric(mid(str,2,1)) AND isnumeric(mid(str,3,1))

    John

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 11-19-2013, 06:53 PM
  2. Formula field
    By vidplaylist in forum Access
    Replies: 1
    Last Post: 12-07-2011, 04:37 PM
  3. Formula field
    By vidplaylist in forum Queries
    Replies: 3
    Last Post: 12-06-2011, 03:45 PM
  4. Replies: 1
    Last Post: 02-03-2011, 11:19 AM
  5. Replies: 1
    Last Post: 03-19-2010, 05:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums