Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8229051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:40:12+00:00 2026-06-07T16:40:12+00:00

I have inherited a MS database, to work from, this database also links to

  • 0

I have inherited a MS database, to work from, this database also links to other programs so I don’t want to change the database tables itself.
I’m using Visual Basic 2010,
What I need to do is have a range of filters on this table and then one extra filter entered by the user.

e.g. they enter ’50’ and range ‘5’ I need to search the dataset using the range of ’45 to 55′
This is my code so far for the dataset:

SELECT [CUTTER NO]
       ,CUTTER_ID
       ,[SIZE-Inches] 
       ,[MM-Across]
       ,[MM-Round]
       ,TYPE 
       ,[LEADING EDGE] 
       ,[CUTTER TYPE]
       ,ACROSS
       ,ROUND
       ,[WIDTH PAPERmm]
       ,[GAPS ACROSSmm]
       ,[GAPS ROUNDmm] 
       ,[Serial Number]
       ,[T G]
       ,Repeat
       ,[Repeat MM] 
       ,[L&G]
       ,Notes
FROM [Cutter List]
WHERE (TYPE <> 'DISCONTINUED') 
  AND (TYPE <> 'SPEC') 
  AND (CUTTER_ID <> NULL) 
  AND ([CUTTER TYPE] = 'MP') 
  AND (TYPE <> 'BUTT')
ORDER BY CUTTER_ID, [MM-Across]

What I need to type into this SQL is:

WHERE [MM-Across] LIKE @[MM-Across] and [MM-Round] LIKE @[MM-Round]

Which from what I can tell on the net is wrong as I cannot have [] in a where.

I even tried :

SELECT        [MM-Across] AS mmacross
FROM            [Cutter List]
WHERE        ('mmacross' LIKE '@mmacross')

This it accepts but I get an different error appear saying

“The Schema returned by the new query differs from the base query.”

What am I doing wrong? I don’t understand the last error or how to avoid this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:40:13+00:00Added an answer on June 7, 2026 at 4:40 pm

    Two things:

    1. You can definitely have brackets “[..]” in WHERE clauses, they just have to be in the correct places (just like anywhere else), and

    2. You cannot use the brackets in variable or parameter references, and that means that, unlike columns, you cannot have special characters in their names, like “-” in “@MM-Across”, so just change your parameter names to something like “@MM_Across”.

    Note that the column names are fine, it’s your parameter and/or variable names that you have to change (I cannot tell which these are from your snippet).

    So instead of this:

    WHERE [MM-Across] LIKE @[MM-Across] and [MM-Round] LIKE @[MM-Round]
    

    Try this:

    WHERE [MM-Across] LIKE @MM_Across and [MM-Round] LIKE @MM_Round
    

    Of course, you will also have to change the parameter/variable names wherever they are declared and passed in. If you post the code that does this, I can show you how to change that also (thoguh it may be obvious by now).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have inherited a database application from someone else and there are a few
I have inherited work from a previous employee. The issue I'm having is a
I have inherited a few programs from a previous developer who was a little
I have inherited a database I need to work with. All the numeric fields
I have inherited a database that has a lot of cursors in it, and
I'm new to Entity Framework and am using Database First. I have inherited a
I have to serialize several objects inheriting from WebControl for database storage. These include
Ok this is going to sound strange, but I have inherited an app that
I've inherited a project which uses Entity Framework Database First. I'm trying to work
I have a reasonably large project at work that I've inherited. It's an ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.