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 7433507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:40:56+00:00 2026-05-29T09:40:56+00:00

This is for a small internal tool to enable a few people to query

  • 0

This is for a small internal tool to enable a few people to query the database. The query has a plus sign as below:

SELECT SUBSTRING(DateName(month,CreatedOn),0,4) + ' - ' + SUBSTRING(CAST(Year(CreatedOn) AS varchar(10)),3,3) as Month, Year(CreatedOn) as Year,

The query is passed to the server using a jquery ajax call

 var d = "query=" + $("#txtQuery").val();
            $.ajax({
                type: 'GET',
                url: '/Reports/GetReport',
                data: d,

However, I get a server error and debugging I find that the query on the server is missing the plus sign. i.e.

 SELECT SUBSTRING(DateName(month,CreatedOn),0,4)  ' - '  SUBSTRING(CAST(Year(CreatedOn) AS varchar(10)),3,3) as Month

And from FireBug,

localhost:1489/Reports/GetReport?query=SELECT%20SUBSTRING(DateName(month,CreatedOn),0,4)%20+%20%27%20-%20%27%20+%20SUBSTRING(CAST(Year(CreatedOn)%20AS%20varchar(10)),3,3)%20as%20Month,%20Year(CreatedOn)%20as%20Year..

How do I ensure that the plus is treated as a part of the input string and not as a concat operator which seems to be the case here.

  • 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-05-29T09:40:57+00:00Added an answer on May 29, 2026 at 9:40 am

    “+” is treated as a space in URIs.

    Use encodeURIComponent.

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

Sidebar

Related Questions

I have this small SQL query. SELECT a.`id` , a.`title` , a.`date` , (
I'm writing an internal-tools webapp; one of the central pages in this tool has
Please imagine this small database... Diagram removed dead ImageShack link - volunteer database diagram
So in a recent project (a small internal tool), I want to experiment with
I just inherited a project for a small company. This is a completely internal
I've got this small question - given a bitmask of weekdays (e.g., Sunday =
I have this small code library that I'm considering releasing into Open Source. I
I have this small class called City that simply holds some information about a
We use this small utility method. But we don't like it. Since it's not
I'm building this small java applet in which I need a JPanel which will

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.