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

  • SEARCH
  • Home
  • 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 9082431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:33:24+00:00 2026-06-16T20:33:24+00:00

Current select statement: SELECT * FROM vw_svc200_open WHERE (CUSTNMBR = ‘::CUSTNMBR::’) ORDER BY ::sortcolumn::

  • 0

Current select statement:

SELECT * 
FROM vw_svc200_open 
WHERE (CUSTNMBR = '::CUSTNMBR::') 
ORDER BY ::sortcolumn::

This works and all is well. But now I need to modify this select string to apply an extra filter.

SELECT * 
FROM vw_svc200_open 
WHERE 
  CASE 
     WHEN ::CUSTNMBR:: = 'ABC123' 
     THEN (CUSTNMBR =  '::CUSTNMBR::' AND CNTCPRSN = '::CNTCPRSN::') 
     ELSE (CUSTNMBR =  '::CUSTNMBR::') 
  END 
ORDER BY ::sortcolumn::

So basically I need to have my select filter on customer number and if customer number is ABC123 then I also need it to filter on Contact person… The problem with the second SELECT (using the CASE statement) is that it throws an “error near =” on the THEN line.

The ::CUSTNMBR:: and ::CNTCPRSN:: are url string variables (What are those called again?).

Ex.

www.mywebsite.com/mypage.asp?Custnmbr=ABC123

Am I going to have to add some logic to the asp page (i.e. IF/Then) to set a variable, and then pass that variable to the *fp_sQry=* line?

  • 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-16T20:33:25+00:00Added an answer on June 16, 2026 at 8:33 pm

    I ended up using nested if statements to set the select statement.

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

Sidebar

Related Questions

My current method is this: SELECT TOP 1 ID FROM DATAENTRY ORDER BY ID
So this isn't really a normal conditional select statement. I current there is a
Current SQL Statement: SELECT count(installUserID) as userCount FROM installUsers group by installationID Current output:
This is my current query: SELECT * FROM users WHERE blah blah... AND users.who
My current query reads: SELECT entry_id, user_id, cat_id, AVG( rating ) as avg_rate FROM
I am trying to create a select list starting from the current date of
I'm trying to build a MySQL select statement to get all data out of
If in a SELECT statement I'm selecting a concatenated string that uses values from
Given the following select statement: Select t.name, SUM(st.row_count) as row_count From sys.dm_db_partition_stats st join
I have the following select statement but unsure how to setup the dynamic action

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.