Query Criteria

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cintury
    New Member
    • May 2007
    • 81

    Query Criteria

    Hello,

    In my query there are two items I want as the criteria. One is the date, and the other is an ID generated from a table. The problem is the table that generates this ID generates it as text so I can't just say >10000.

    Is there any way this "criteria" field can differentiate between text length?
    For example the IDs that I want to show up in the results have atleast 10 digits, and everything below 10 digits I do not want in my results.
  • janders468
    Recognized Expert New Member
    • Mar 2008
    • 112

    #2
    There are a couple of ways you could go about this. If you know that this will always be a number, even though it is stored as text, you can coerce it to a number and test against that such as Clng(ID) or CInt(ID). If you want to do it based on the length of the string then you could use the Len function i.e. Len(ID)

    Comment

    Working...