Ask a Question related to ASP Database, Design and Development.
-
Steve G #1
Splitting values
Hi All...
I am really stumped on something I am trying to do.
I have a table named games with the following fields: gameID, homeTeam,
homeScore, visitingTeam, vistingScore.
When I pull records thusly: (two records in this instance)
Select * from games
then display all the records with a do while loop, everything comes in all
right, but I need to create a string value that would look somthing like
hometeam homescore visitingteam visitingscore, hometeam homescore
visitingteam visiting score.
I need to be able to use this string as a scroll.
I can create a string by using getRows, and comma delimit it, but I end up
with:
homeTeam,homeScore,visitingTeam,visitingScore,
Any advice or help would be very much appreciated.
Steve G
Steve G Guest
-
Intelligent PDF Splitting
Does anyone have information about intelligent PDF splitting, using either command line or applescript? -
Splitting a CSV list
I have the following type of data in a page and I need to be able to pull each and every CN value without the CN or anything behind it. ... -
PHP variable splitting
Is there a command in PHP that will allow me to split a text variable into an array by length rather than using a delimiter? What I want to do is... -
Splitting a Logo
Hi Is it possible to split a Logo cleanly in half and if so how would i do this? TOON TOON. -
Splitting up an XML File
I have an XML file that looks like this: <root> <economist publications="true" > <name> <first>John</first> <last>Doe</last> </name>... -
Steve G #2
Re: Splitting values Correction
Sorry...just realized I mis-discribed the SQL statement, it should be:
Select homeTeam, homeScore, visitingTeam, visitingScore from games
Steve
"Steve G" <steve@nospam.tnccreations.com> wrote in message
news:uKbT63rlDHA.2616@TK2MSFTNGP11.phx.gbl...> Hi All...
>
> I am really stumped on something I am trying to do.
>
> I have a table named games with the following fields: gameID, homeTeam,
> homeScore, visitingTeam, vistingScore.
>
> When I pull records thusly: (two records in this instance)
> Select * from games
> then display all the records with a do while loop, everything comes in all
> right, but I need to create a string value that would look somthing like
> hometeam homescore visitingteam visitingscore, hometeam homescore
> visitingteam visiting score.
> I need to be able to use this string as a scroll.
>
> I can create a string by using getRows, and comma delimit it, but I end up
> with:
> homeTeam,homeScore,visitingTeam,visitingScore,
>
> Any advice or help would be very much appreciated.
>
> Steve G
>
>
Steve G Guest
-
McKirahan #3
Re: Splitting values Correction
"Steve G" <steve@nospam.tnccreations.com> wrote in message
news:uoKO27rlDHA.964@TK2MSFTNGP10.phx.gbl...all> Sorry...just realized I mis-discribed the SQL statement, it should be:
> Select homeTeam, homeScore, visitingTeam, visitingScore from games
>
> Steve
>
> "Steve G" <steve@nospam.tnccreations.com> wrote in message
> news:uKbT63rlDHA.2616@TK2MSFTNGP11.phx.gbl...> > Hi All...
> >
> > I am really stumped on something I am trying to do.
> >
> > I have a table named games with the following fields: gameID, homeTeam,
> > homeScore, visitingTeam, vistingScore.
> >
> > When I pull records thusly: (two records in this instance)
> > Select * from games
> > then display all the records with a do while loop, everything comes inup> > right, but I need to create a string value that would look somthing like
> > hometeam homescore visitingteam visitingscore, hometeam homescore
> > visitingteam visiting score.
> > I need to be able to use this string as a scroll.
> >
> > I can create a string by using getRows, and comma delimit it, but I endI may not understand your problem but here goes...> > with:
> > homeTeam,homeScore,visitingTeam,visitingScore,
> >
> > Any advice or help would be very much appreciated.
> >
> > Steve G
If you can get :
homeTeam,homeScore,visitingTeam,visitingScore
and you want :
homeTeam homeScore visitingTeam visitingScore
and it's returned in a string ("s"), try :
s = Replace(s,","," ")
Also, what do you mean by :
"I need to be able to use this string as a scroll."?
McKirahan Guest
-
Steve G #4
Re: Splitting values Correction
Thanks for the response.
The idea is that we will pull scores dynamically from the database, as they
are entered by coaches, and then place them in a scroll across the top of
the page.
If I am interpreting your suggestion correctly, and there are scores from
two games posted, I think I would end up with:
homeTeam homeScore visitingTeam visitingScore homeTeam homeScore
visitingTeam visitingScore
instead of:
homeTeam homeScore visitingTeam visitingScore,homeTeam homeScore
visitingTeam visitingScore,
I need to be able to split on the commas in the above string, so I can
create dynamically parameter values for each game, but obviously, first I
need to be able to create the string.
Thanks
Steve G
"McKirahan" <News@McKirahan.com> wrote in message
news:OuJkb.823058$YN5.851331@sccrnsc01...homeTeam,> "Steve G" <steve@nospam.tnccreations.com> wrote in message
> news:uoKO27rlDHA.964@TK2MSFTNGP10.phx.gbl...> > Sorry...just realized I mis-discribed the SQL statement, it should be:
> > Select homeTeam, homeScore, visitingTeam, visitingScore from games
> >
> > Steve
> >
> > "Steve G" <steve@nospam.tnccreations.com> wrote in message
> > news:uKbT63rlDHA.2616@TK2MSFTNGP11.phx.gbl...> > > Hi All...
> > >
> > > I am really stumped on something I am trying to do.
> > >
> > > I have a table named games with the following fields: gameID,like> all> > > homeScore, visitingTeam, vistingScore.
> > >
> > > When I pull records thusly: (two records in this instance)
> > > Select * from games
> > > then display all the records with a do while loop, everything comes in> > > right, but I need to create a string value that would look somthingend> > > hometeam homescore visitingteam visitingscore, hometeam homescore
> > > visitingteam visiting score.
> > > I need to be able to use this string as a scroll.
> > >
> > > I can create a string by using getRows, and comma delimit it, but I> up>> > > with:
> > > homeTeam,homeScore,visitingTeam,visitingScore,
> > >
> > > Any advice or help would be very much appreciated.
> > >
> > > Steve G
> I may not understand your problem but here goes...
>
> If you can get :
> homeTeam,homeScore,visitingTeam,visitingScore
>
> and you want :
> homeTeam homeScore visitingTeam visitingScore
>
> and it's returned in a string ("s"), try :
>
> s = Replace(s,","," ")
>
> Also, what do you mean by :
> "I need to be able to use this string as a scroll."?
>
>
Steve G Guest
-
Ken Schaefer #5
Re: Splitting values Correction
This is simple string manipulation. If you want a comma at the end of every
record, you can use GetString with no column delimiter, and a , as a row
delimiter. If you want to use GetRows then, you can do:
<%
If isArray(arrResults) then
For i = 0 to UBound(arrResults, 2)
For j = 0 to Ubound(arrResults, 1)
strValue = strValue & " " & arrResults(j,i)
Next
strValue = strValue & ", "
Next
End If
%>
If you want to strip the trailing comma (no comma after the last set of
results) then
<%
strValue = Left(strValue, Len(strValue) -1)
%>
Cheers
Ken
"Steve G" <steve@nospam.tnccreations.com> wrote in message
news:e536EXslDHA.1488@TK2MSFTNGP12.phx.gbl...
: Thanks for the response.
:
: The idea is that we will pull scores dynamically from the database, as
they
: are entered by coaches, and then place them in a scroll across the top of
: the page.
:
: If I am interpreting your suggestion correctly, and there are scores from
: two games posted, I think I would end up with:
:
: homeTeam homeScore visitingTeam visitingScore homeTeam homeScore
: visitingTeam visitingScore
:
: instead of:
:
: homeTeam homeScore visitingTeam visitingScore,homeTeam homeScore
: visitingTeam visitingScore,
:
: I need to be able to split on the commas in the above string, so I can
: create dynamically parameter values for each game, but obviously, first I
: need to be able to create the string.
:
: Thanks
:
: Steve G
:
: "McKirahan" <News@McKirahan.com> wrote in message
: news:OuJkb.823058$YN5.851331@sccrnsc01...
: > "Steve G" <steve@nospam.tnccreations.com> wrote in message
: > news:uoKO27rlDHA.964@TK2MSFTNGP10.phx.gbl...
: > > Sorry...just realized I mis-discribed the SQL statement, it should be:
: > > Select homeTeam, homeScore, visitingTeam, visitingScore from games
: > >
: > > Steve
: > >
: > > "Steve G" <steve@nospam.tnccreations.com> wrote in message
: > > news:uKbT63rlDHA.2616@TK2MSFTNGP11.phx.gbl...
: > > > Hi All...
: > > >
: > > > I am really stumped on something I am trying to do.
: > > >
: > > > I have a table named games with the following fields: gameID,
: homeTeam,
: > > > homeScore, visitingTeam, vistingScore.
: > > >
: > > > When I pull records thusly: (two records in this instance)
: > > > Select * from games
: > > > then display all the records with a do while loop, everything comes
in
: > all
: > > > right, but I need to create a string value that would look somthing
: like
: > > > hometeam homescore visitingteam visitingscore, hometeam homescore
: > > > visitingteam visiting score.
: > > > I need to be able to use this string as a scroll.
: > > >
: > > > I can create a string by using getRows, and comma delimit it, but I
: end
: > up
: > > > with:
: > > > homeTeam,homeScore,visitingTeam,visitingScore,
: > > >
: > > > Any advice or help would be very much appreciated.
: > > >
: > > > Steve G
: >
: > I may not understand your problem but here goes...
: >
: > If you can get :
: > homeTeam,homeScore,visitingTeam,visitingScore
: >
: > and you want :
: > homeTeam homeScore visitingTeam visitingScore
: >
: > and it's returned in a string ("s"), try :
: >
: > s = Replace(s,","," ")
: >
: > Also, what do you mean by :
: > "I need to be able to use this string as a scroll."?
: >
: >
:
:
Ken Schaefer Guest
-
Steve G #6
Re: Splitting values Correction
Yep..that did the trick...
As always, thanks, Ken
Steve G
"Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
news:OrjAWbslDHA.2080@TK2MSFTNGP10.phx.gbl...every> This is simple string manipulation. If you want a comma at the end ofof> record, you can use GetString with no column delimiter, and a , as a row
> delimiter. If you want to use GetRows then, you can do:
>
> <%
> If isArray(arrResults) then
>
> For i = 0 to UBound(arrResults, 2)
>
> For j = 0 to Ubound(arrResults, 1)
>
> strValue = strValue & " " & arrResults(j,i)
>
> Next
>
> strValue = strValue & ", "
>
> Next
>
> End If
> %>
>
> If you want to strip the trailing comma (no comma after the last set of
> results) then
>
> <%
> strValue = Left(strValue, Len(strValue) -1)
> %>
>
> Cheers
> Ken
>
>
> "Steve G" <steve@nospam.tnccreations.com> wrote in message
> news:e536EXslDHA.1488@TK2MSFTNGP12.phx.gbl...
> : Thanks for the response.
> :
> : The idea is that we will pull scores dynamically from the database, as
> they
> : are entered by coaches, and then place them in a scroll across the topfrom> : the page.
> :
> : If I am interpreting your suggestion correctly, and there are scoresI> : two games posted, I think I would end up with:
> :
> : homeTeam homeScore visitingTeam visitingScore homeTeam homeScore
> : visitingTeam visitingScore
> :
> : instead of:
> :
> : homeTeam homeScore visitingTeam visitingScore,homeTeam homeScore
> : visitingTeam visitingScore,
> :
> : I need to be able to split on the commas in the above string, so I can
> : create dynamically parameter values for each game, but obviously, firstbe:> : need to be able to create the string.
> :
> : Thanks
> :
> : Steve G
> :
> : "McKirahan" <News@McKirahan.com> wrote in message
> : news:OuJkb.823058$YN5.851331@sccrnsc01...
> : > "Steve G" <steve@nospam.tnccreations.com> wrote in message
> : > news:uoKO27rlDHA.964@TK2MSFTNGP10.phx.gbl...
> : > > Sorry...just realized I mis-discribed the SQL statement, it shouldcomes> : > > Select homeTeam, homeScore, visitingTeam, visitingScore from games
> : > >
> : > > Steve
> : > >
> : > > "Steve G" <steve@nospam.tnccreations.com> wrote in message
> : > > news:uKbT63rlDHA.2616@TK2MSFTNGP11.phx.gbl...
> : > > > Hi All...
> : > > >
> : > > > I am really stumped on something I am trying to do.
> : > > >
> : > > > I have a table named games with the following fields: gameID,
> : homeTeam,
> : > > > homeScore, visitingTeam, vistingScore.
> : > > >
> : > > > When I pull records thusly: (two records in this instance)
> : > > > Select * from games
> : > > > then display all the records with a do while loop, everythingsomthing> in
> : > all
> : > > > right, but I need to create a string value that would lookI> : like
> : > > > hometeam homescore visitingteam visitingscore, hometeam homescore
> : > > > visitingteam visiting score.
> : > > > I need to be able to use this string as a scroll.
> : > > >
> : > > > I can create a string by using getRows, and comma delimit it, but> : end
> : > up
> : > > > with:
> : > > > homeTeam,homeScore,visitingTeam,visitingScore,
> : > > >
> : > > > Any advice or help would be very much appreciated.
> : > > >
> : > > > Steve G
> : >
> : > I may not understand your problem but here goes...
> : >
> : > If you can get :
> : > homeTeam,homeScore,visitingTeam,visitingScore
> : >
> : > and you want :
> : > homeTeam homeScore visitingTeam visitingScore
> : >
> : > and it's returned in a string ("s"), try :
> : >
> : > s = Replace(s,","," ")
> : >
> : > Also, what do you mean by :
> : > "I need to be able to use this string as a scroll."?
> : >
> : >
> :
> :
>
>
Steve G Guest
-
Anorlu #7
Re: Splitting values
Hi,
why don't you to this :
select gameID,
homeTeam + ' ' + homeScore as HOME,
visitingTeam + ' ' + vistingScore as VISIT
from games
----so you will get per game the both teams and scores.
So for : hometeam homescore - visitingteam visitingscore
select gameID,
homeTeam + ' ' + homeScore + ' - 'visitingTeam + ' ' +
vistingScore as MYTEXT
from games
---- so you will get per game the whole string MYTEXT you need
Hope that helps you !
Ann
"Steve G" <steve@nospam.tnccreations.com> wrote in message news:<uKbT63rlDHA.2616@TK2MSFTNGP11.phx.gbl>...> Hi All...
>
> I am really stumped on something I am trying to do.
>
> I have a table named games with the following fields: gameID, homeTeam,
> homeScore, visitingTeam, vistingScore.
>
> When I pull records thusly: (two records in this instance)
> Select * from games
> then display all the records with a do while loop, everything comes in all
> right, but I need to create a string value that would look somthing like
> hometeam homescore visitingteam visitingscore, hometeam homescore
> visitingteam visiting score.
> I need to be able to use this string as a scroll.
>
> I can create a string by using getRows, and comma delimit it, but I end up
> with:
> homeTeam,homeScore,visitingTeam,visitingScore,
>
> Any advice or help would be very much appreciated.
>
> Steve GAnorlu Guest
-
Steve G #8
Re: Splitting values-Count
Hi All...
One last question, I hope <S>
Utilizing what Ken gave me, I now have the team name and score coming in
correctly. I now need to set one additional parameter value, which is
basically a count.
If I use this: (where there are two records)
for m = 1 to count
caption = caption + 1
response.write caption
next
the result is (1)(2) (parenthesis added for clarity).
This makes sense from the syntax, but I need it to read (0)(1) - working
with an applet, whose first parameter caption value must be 0.
As always, any help would be much appreciated.
Steve G
"Steve G" <steve@nospam.tnccreations.com> wrote in message
news:uKbT63rlDHA.2616@TK2MSFTNGP11.phx.gbl...> Hi All...
>
> I am really stumped on something I am trying to do.
>
> I have a table named games with the following fields: gameID, homeTeam,
> homeScore, visitingTeam, vistingScore.
>
> When I pull records thusly: (two records in this instance)
> Select * from games
> then display all the records with a do while loop, everything comes in all
> right, but I need to create a string value that would look somthing like
> hometeam homescore visitingteam visitingscore, hometeam homescore
> visitingteam visiting score.
> I need to be able to use this string as a scroll.
>
> I can create a string by using getRows, and comma delimit it, but I end up
> with:
> homeTeam,homeScore,visitingTeam,visitingScore,
>
> Any advice or help would be very much appreciated.
>
> Steve G
>
>
Steve G Guest
-
McKirahan #9
Re: Splitting values-Count
"Steve G" <steve@nospam.tnccreations.com> wrote in message
news:u132n9wlDHA.1084@tk2msftngp13.phx.gbl...for m = 0 to count> Hi All...
>
> One last question, I hope <S>
>
> Utilizing what Ken gave me, I now have the team name and score coming in
> correctly. I now need to set one additional parameter value, which is
> basically a count.
>
> If I use this: (where there are two records)
> for m = 1 to count
> caption = caption + 1
> response.write caption
> next
>
> the result is (1)(2) (parenthesis added for clarity).
>
> This makes sense from the syntax, but I need it to read (0)(1) - working
> with an applet, whose first parameter caption value must be 0.
>
> As always, any help would be much appreciated.
>
> Steve G
>
McKirahan Guest
-
Steve G #10
Re: Splitting values-Count
You're right...sorry, going on a little sleep deprivation here. That should
have read m = 0 to count which would then produce the results I described
below; i.e., (1)(2)
Steve
"McKirahan" <News@McKirahan.com> wrote in message
news:xJRkb.826200$YN5.856708@sccrnsc01...> "Steve G" <steve@nospam.tnccreations.com> wrote in message
> news:u132n9wlDHA.1084@tk2msftngp13.phx.gbl...>> > Hi All...
> >
> > One last question, I hope <S>
> >
> > Utilizing what Ken gave me, I now have the team name and score coming in
> > correctly. I now need to set one additional parameter value, which is
> > basically a count.
> >
> > If I use this: (where there are two records)
> > for m = 1 to count
> > caption = caption + 1
> > response.write caption
> > next
> >
> > the result is (1)(2) (parenthesis added for clarity).
> >
> > This makes sense from the syntax, but I need it to read (0)(1) - working
> > with an applet, whose first parameter caption value must be 0.
> >
> > As always, any help would be much appreciated.
> >
> > Steve G
> >
> for m = 0 to count
>
>
Steve G Guest
-
McKirahan #11
Re: Splitting values-Count
"Steve G" <steve@nospam.tnccreations.com> wrote in message
news:OJqBdJxlDHA.2432@TK2MSFTNGP10.phx.gbl...should> You're right...sorry, going on a little sleep deprivation here. Thatin> have read m = 0 to count which would then produce the results I described
> below; i.e., (1)(2)
>
> Steve
>
>
> "McKirahan" <News@McKirahan.com> wrote in message
> news:xJRkb.826200$YN5.856708@sccrnsc01...> > "Steve G" <steve@nospam.tnccreations.com> wrote in message
> > news:u132n9wlDHA.1084@tk2msftngp13.phx.gbl...> > > Hi All...
> > >
> > > One last question, I hope <S>
> > >
> > > Utilizing what Ken gave me, I now have the team name and score comingworking> > > correctly. I now need to set one additional parameter value, which is
> > > basically a count.
> > >
> > > If I use this: (where there are two records)
> > > for m = 1 to count
> > > caption = caption + 1
> > > response.write caption
> > > next
> > >
> > > the result is (1)(2) (parenthesis added for clarity).
> > >
> > > This makes sense from the syntax, but I need it to read (0)(1) -> >> > > with an applet, whose first parameter caption value must be 0.
> > >
> > > As always, any help would be much appreciated.
> > >
> > > Steve G
> > >
> > for m = 0 to count
> >
You'll have to post your code.
I didn't see a variable named "caption" in Ken's code.
What is it initialized to?
McKirahan Guest
-
Ken Schaefer #12
Re: Splitting values-Count
caption = 0
For m = 1 to count
Response.Write(caption)
caption = caption + 1
Next
Cheers
Ken
"Steve G" <steve@nospam.tnccreations.com> wrote in message
news:u132n9wlDHA.1084@tk2msftngp13.phx.gbl...
: Hi All...
:
: One last question, I hope <S>
:
: Utilizing what Ken gave me, I now have the team name and score coming in
: correctly. I now need to set one additional parameter value, which is
: basically a count.
:
: If I use this: (where there are two records)
: for m = 1 to count
: caption = caption + 1
: response.write caption
: next
:
: the result is (1)(2) (parenthesis added for clarity).
:
: This makes sense from the syntax, but I need it to read (0)(1) - working
: with an applet, whose first parameter caption value must be 0.
:
: As always, any help would be much appreciated.
:
: Steve G
:
: "Steve G" <steve@nospam.tnccreations.com> wrote in message
: news:uKbT63rlDHA.2616@TK2MSFTNGP11.phx.gbl...
: > Hi All...
: >
: > I am really stumped on something I am trying to do.
: >
: > I have a table named games with the following fields: gameID, homeTeam,
: > homeScore, visitingTeam, vistingScore.
: >
: > When I pull records thusly: (two records in this instance)
: > Select * from games
: > then display all the records with a do while loop, everything comes in
all
: > right, but I need to create a string value that would look somthing like
: > hometeam homescore visitingteam visitingscore, hometeam homescore
: > visitingteam visiting score.
: > I need to be able to use this string as a scroll.
: >
: > I can create a string by using getRows, and comma delimit it, but I end
up
: > with:
: > homeTeam,homeScore,visitingTeam,visitingScore,
: >
: > Any advice or help would be very much appreciated.
: >
: > Steve G
: >
: >
:
:
Ken Schaefer Guest



Reply With Quote

