Home » questions » Validation in SQL using Like Operand?

Validation in SQL using Like Operand?

2006-08-17 10:00:14, Category: Programming & Design
I'm stuck on this one and google isn't helping. Trying to validate data entry using a query in access but running through ADO. It all runs fine until it tries to validate an id number like this: VAL_member_id: IIf([member_id]<>"" And ([member_id] Like "____-_____" Or [member_id] Like "#-#" Or [member_id] Like "#-##" Or [member_id] Like "#-###" Or [member_id] Like "#-####" Or [member_id] Like "#-#####" Or [member_id] Like "#-######" Or [member_id] Like "#-#######"),True,False) When it runs in Access it comes up True but when it's run through the ADO/ODBC driver it comes up False. I can't see a problem with it though. It's probably gonna be something simple. xD

Answers

  1. kashmoney

    On 2006-08-17 10:08:28


    substring the member_id and use the isNumeric on both pieces.
  2. hswes

    On 2006-08-17 13:00:29


    Have you tried to use single quotes, because when you run to ODBC it comes often to a wrong evaluation using double quotes. I hope it will help you Helmut
  3. pianoplayerontheroof

    On 2006-08-17 10:08:14


    the first step is to find a forum where people actually know what you're talking about. Many of the answers you'll get here are of the "heck, I dunno either" sort, and that's when you're asking questions like, "What is a Server?"