Prev: 2 quesions about query
Next: arr records except last
From: Silvio on 23 Mar 2010 11:41 Hello folks, I am trying to exclude record from a query that start with a letter followed by the underscore and other letters. Example: B_test B_test2 B_Hello B_Mach B_yellow BA BT In this example, I need to exclude anything that starts with B_ My understanding is to use the NOT Like function in that colum criteria such as: Like 'B[_]%' However, it does not do anything (I still get all the records). I know that underscore is in SQL is not being considered laterally. So how do I handle this? Thank you, Silvio
From: ghetto_banjo on 23 Mar 2010 11:53 This worked for me: Not Like "B_" & "*"
From: Jerry Whittle on 23 Mar 2010 11:55 Are you linked to an Oracle database? The % wildcard implies so. For Access the following will work: Not Like "B_*" -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Silvio" wrote: > Hello folks, I am trying to exclude record from a query that start with a > letter followed by the underscore and other letters. Example: > > B_test > B_test2 > B_Hello > B_Mach > B_yellow > BA > BT > > In this example, I need to exclude anything that starts with B_ > > My understanding is to use the NOT Like function in that colum criteria such > as: > > Like 'B[_]%' > > However, it does not do anything (I still get all the records). I know that > underscore is in SQL is not being considered laterally. So how do I handle > this? > > Thank you, > Silvio
From: Silvio on 23 Mar 2010 12:14 Hi Jerry, I am using an ODBC connection to SQL server with Microsoft Access 2007. I tried Not Like"B_*" and that excludes anything that strats with B and not just B_ "Jerry Whittle" wrote: > Are you linked to an Oracle database? The % wildcard implies so. > > For Access the following will work: > > Not Like "B_*" > -- > Jerry Whittle, Microsoft Access MVP > Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. > > > "Silvio" wrote: > > > Hello folks, I am trying to exclude record from a query that start with a > > letter followed by the underscore and other letters. Example: > > > > B_test > > B_test2 > > B_Hello > > B_Mach > > B_yellow > > BA > > BT > > > > In this example, I need to exclude anything that starts with B_ > > > > My understanding is to use the NOT Like function in that colum criteria such > > as: > > > > Like 'B[_]%' > > > > However, it does not do anything (I still get all the records). I know that > > underscore is in SQL is not being considered laterally. So how do I handle > > this? > > > > Thank you, > > Silvio
From: John Spencer on 23 Mar 2010 12:14
Try the following NOT Like 'B[_]%' Or more generally - any letter followed by an underscore NOT Like '[a-z][_]%' Or even more general - any character followed by an underscore NOT Like '_[_]%' John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Silvio wrote: > Hello folks, I am trying to exclude record from a query that start with a > letter followed by the underscore and other letters. Example: > > B_test > B_test2 > B_Hello > B_Mach > B_yellow > BA > BT > > In this example, I need to exclude anything that starts with B_ > > My understanding is to use the NOT Like function in that colum criteria such > as: > > Like 'B[_]%' > > However, it does not do anything (I still get all the records). I know that > underscore is in SQL is not being considered laterally. So how do I handle > this? > > Thank you, > Silvio |