Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse Street Name 1

Status
Not open for further replies.

mwake

Programmer
Feb 12, 2004
151
US
I'm using CR2011 with a SQL Server database as my data source. I am trying to create a Top 10 report based on completed taxi orders by street. I was able to create a formula which extracts the street name:

Mid ({CompletedOrders.Address1},InStr ({CompletedOrders.Address1}," ") )

but I am getting an error message (Start position is less than 1 and not an integer) when attempting to group on my formula. What formula can I use to parse the street name and then group on the name so I can do order counts??
 
You're getting the error because there is no space in the Address one field so InStr is returning 0. Try this instead:

if InStr({CompletedOrders.Address1}," ") > 0 then
Mid({CompletedOrders.Address1},InStr({CompletedOrders.Address1}," ")+1 )
else
{CompletedOrders.Address1}

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
 
Thanks Dell. That worked perfectly!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top