Author Topic: Adding a "+" to spaces  (Read 252 times)

Offline jessimica602

  • Full Member
  • ***
  • Join Date: Jan 2020
  • Posts: 13
  • Forum Citizenship: +0/-0
Adding a "+" to spaces
« on: 30 Jun 2021 04:05:31 pm »
Hey all,

Maybe I'm going about this all wrong or maybe someone has a better idea on how to do this...
I am trying to add a link to my report that has a google link to for finding the distance between two address; an example of the link is https://www.google.com/maps?f=d&source=s_d&saddr=9666+Old+Katy+Rd,+Houston,+TX+77055&daddr=901+Corbindale+Rd,+Houston,+TX+77024

I have the two fields for the addresses but can't figure out how to add the "+" in the spaces. Does anyone have an idea how to get this done, or a better idea how to handle this?

Thank you!!!!

Offline BigChris

  • Statesman
  • ******
  • Join Date: Apr 2013
  • Posts: 1,251
  • Forum Citizenship: +91/-0
Re: Adding a "+" to spaces
« Reply #1 on: 01 Jul 2021 04:09:46 am »
Hi - you don't say what platform you're using, but if you're using SQL Server there's a function there that sounds like it would work for you:

replace ( string_expression1 , string_expression2 , string_expression3 )
Replaces all occurrences of "string_expression2" in "string_expression1" with "string_expression3".

Offline jessimica602

  • Full Member
  • ***
  • Join Date: Jan 2020
  • Posts: 13
  • Forum Citizenship: +0/-0
Re: Adding a "+" to spaces
« Reply #2 on: 21 Jul 2021 10:39:24 am »
Sorry for the long wait on this

Not SQL Server, just using query calculations in Cognos 11

I tried replace out of curiosity    replace([EE address Full],' ', '+')

but get the following error: "UDA-QOS-0006 error  UDA -SQL-0219 The function "replace" is being used for local processing but is not available as a built-in function, or at least one of its parameters is not supported"

I'm digging around seeing if there is any other solution to this.

Thank you!

Offline jessimica602

  • Full Member
  • ***
  • Join Date: Jan 2020
  • Posts: 13
  • Forum Citizenship: +0/-0
Re: Adding a "+" to spaces
« Reply #3 on: 21 Jul 2021 12:35:31 pm »
Got it to work!!!!!!!!

Thank you!

Online bus_pass_man

  • Statesman
  • ******
  • Join Date: May 2008
  • Posts: 477
  • Forum Citizenship: +45/-0
Re: Adding a "+" to spaces
« Reply #4 on: 21 Jul 2021 01:46:49 pm »
Would it be a violation of the Official Secrets Act to describe how you solved the problem, in case other people wish to do the same thing?