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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:12:51+00:00 2026-05-21T10:12:51+00:00

I have a SQL table full of logs that shows response time from my

  • 0

I have a SQL table full of logs that shows response time from my pages. For example:

/MyPage1.aspx
/MyPage2.aspx
/MyPage3.aspx?index=4
/MyPage3.aspx?index=5
/MyPage3.aspx?index=7

However, I want to create a view that shows me the average load time for each page. To do this, I don’t want the query strings included since I just want to group the pages by their URL before the question mark (so /MyPage3.aspx only shows up once).

What string functions are appropriate here to strip out the query string?

  • 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-21T10:12:51+00:00Added an answer on May 21, 2026 at 10:12 am

    The tricky part here is…. the data doesn’t always include a ? mark. You can find the position of the ? using the charindex, but to select the data to the left of it, you need to use CharIndex – 1. If the ? isn’t found, CharIndex returns 0, and Left(data, 0-1) results in an error.

    The simple solution is to make sure there is always something for the CharIndex to find. Like this:

    Select Left(URL, CharIndex('?', URL + '?')-1)
    From   @Temp
    

    Notice that I do CharIndex of URL + ‘?’. If the data does not contain a question mark, the charindex function will return a value 1 greater than the length of the string which works nicely for the left function.

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

Sidebar

Related Questions

i have a sql table full of address' like this Hattie:07903 000066::Dad:07854 000095::Tom:07903 000044::Allistair:07765
I have added Full Text Search to my sql server 2008 express database and
I do not have 'full' the version of MS SQL (SQL Express 2008) so
I am working on the Full Text Search in Sql Server 2005. I have
I have table that has a column of type DateTime, I would like to
i have a table with two columns and two records as follows. TypeOfReport Links
I have a table with three columns NodeId, ParentNodeId, NodeName. for each node I
We're using SqlServer 2008. In SSMS, queries on the full text catalog might take
I am looking to apply SQL column level encryption using symmetric keys. The initial
Okay so right now I'm working on a program that has a whole bunch

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.