Splitting Values From A Recordset

I have two records pulled from the same field in a table, so it would look like this

NAMES (Field name)
John (forename)
Smith (surname) There will always be 2 records

I need to take both these records and split them into two variables - one for the forename and one for the surname - (I need to insert these values into SQL statement)

Have tried the following code 'firstname' contains both the first and second name.

Code:

View Replies


ADVERTISEMENT

Splitting Values From A Select Box ?

I have this SELECT box which allows users to select multiple items to delete... however if they select 2 or more items... the values get passed over as 'one, two'

So the sql looks like Delete From Table Where Field='one, two';

How do i do it in such a way that it becomes:

Delete From Table Where Field='one';
Delete From Table Where Field='two';?

View Replies View Related

Recordset Values

I'm again having trouble putting ASP records INSIDE html link.
Here's the string I put inside Access field:

No room number specified (<a
href='contact.asp?subject=corrections/addition for AASG.info group ID
<%=(Recordset1.Fields.Item('group_id').Value)%>'>update</a>)

but it is not working. The link created in my html output puts out asp
part LITERALLY and does not put the VALUE of the recordset.

This didn't work either:

No room number specified (<a
href="contact.asp?subject=corrections/addition for AASG.info group ID
<%=(Recordset1.Fields.Item('group_id').Value)%>">update</a>

View Replies View Related

Recordset Values

I have a recordset which displays a feild with the initial value of 1, I want to be able to increase the value with whatever numer I choose.if I set antall = antall + 1, It increases with 1 nomather what number you put in, how can I make it work the way I want.

antall = antall + ?

View Replies View Related

Comparing Recordset Values

i have a a SQL stored SP bringing out one recordset, I have a loop reading out all the records, what I would like to do it compare each record to the previous one and if it is the same then do something. I'm having trouble figuring out how to do the comparison as I loop through the records

View Replies View Related

Null Values From Recordset

I'm reading records from a recordset and placing them in a table. One of these fields is a date value and I format it using the following:

Code:

<%=FormatDateTime(oRs.Fields.item("DateRecd"), vbShortDate)%>

If this field contains no data, how can I display it without getting an error?

View Replies View Related

Most Popular Values In A Recordset

I am trying to soleve the following problem using an asp recordset (connects to sql)
A column in the recordset contains integers between 1 and 5. I am trying to find a way of concluding which integer is the most common, then the second most common, then the third. (In the event of a tie, the higher integer 'wins').

Hence if in the record set there were 5 1s, 4 2s, 7 3s, 1 4 and 5 5s the output would be Most popular = 7, send most popular = 1 and third most popular = 5. I am familiar with rhe recordset objects ie looping through the records etc .

View Replies View Related

Problem Filtering Recordset By Values Held In Array

I am trying to filter a table of users to select only those records
whose roleID matches a value in an array. There could be any number of
IDs held in the array from one to a few hundred. The array is
generated by splitting a comma delimited memo field from a second
table in an Access DB. I can split the memo field OK, I can
response.write its values, but what I now want to do is add a value
from another table to my reponse write loop. Code:

View Replies View Related

RecordSet (and GetRows) Is Retrieving Null Values When They Aren't Null

I have an interesting situation that needs to be addressed ASAP.

I am running a standard SQL Query in ASP to retrieve some rows/columns from a table that's on a SQL Server 2000 database. I put the results of that query into a RecordSet, and then use the GetRows function to push the results that are in the recordset into an array variable. In the query that I am running, 39 columns and 2 rows are returned.

The GetRows function appears to be working - the array variable is being created with the proper dimensions. However, the values of the different "cells" of the array are not showing up correctly. The first and the last column values for each row are correct, yet everything else in between is blank, empty, NULL, or whatever.

In other words: ArrayVariable(0,0) shows up correctly, ArrayVariable(38,0) shows up correctly, but everything in between is null.

I did a test on the RecordSet and discovered that it was the culprit - it wasn't being filled in properly. This is strange, though, because the select query that I run in the ASP code to create the recordset returns perfect results when I run it on the SQL Server 2K database.

View Replies View Related

Splitting Up A Date

I am having a problem with getting my date to display in the format needed. The date is being called up from a database in the form of the date and time but I need to have the them both seperate from each other. Its for a message board app I'm currently developing. I've tried various methods but none have worked so far. I am using this code at the moment:

<%Response.Write FormatDateTime(sectionRS("MesDate"), vbGeneralDate)%>

The result comes out the same as if no formatting is used. Do I need to create a variable for the value being called up from the database?

View Replies View Related

Splitting Arrays

I have a string that looks like this: a|b|c|d%e|f| ...

I split once on "%"

ar1 = Split(Mystring, "%")

then when I try and split the ar1 by

ar2 = Split(ar1, "|")

I get error '800a000d' Type mismatch

I have tried
ar2 = Split(Cstr(ar1), "|")

How can I split this string?

View Replies View Related

Splitting A String

I have a var with the value of ADED I want to be able to break this var into an array of 4 elements, or it could be three, depending on the value of the variable.
I tried the following but got nothing.
Code:

dim strVar, arrVar
strVar = Request.QueryString("strVar")

arrVar(0) = Left(strVar, 1)
arrVar(1) = Mid(strVar, 2, 1)
arrVar(2) = Mid(strVar, 3, 1)
arrVar(3) = right(strVar, 1)

When I try to response.write(arrVar(2)), i get nothing. What am I doing wrong?

View Replies View Related

Splitting Data

i need to write a query that splits forname and surname that are held in the same col of a db eg old form requested for name(so users just put sarah smith)
but I have added another col forname in the db and the forms now collect forname and surnane into seperate field but I have to now split the old data and put ot into the separate fields can anyone point me in the right direction.

View Replies View Related

Splitting 1 Column Into 2

Pretty basic but I cannot figure it out.

Column:
FULLNAME (lname, fname)

Needs to be

FNAME
LNAME

Should split at the comman.I already have all the columns created; just
need to SQL command to make it happen.

View Replies View Related

Splitting This String

i get the querysting like this:
www.abc.com?email=abc@abc.com phone=33333333
Now i want to split this string so that i can just pass the phone number to the variable in my program so that the fax gets going.

Can you please let me know how i can split this string and just get the phone number to be passed to the variable ,so that i can initialte the next function of send fax?

View Replies View Related

Splitting Value From A Select Box?

I have this SELECT box which allows users to select multiple items to delete... however if they select 2 or more items... the values get passed over as 'one, two' so the sql looks like Delete From Table Where Field='one, two';

How do i do it in such a way that it becomes:

Delete From Table Where Field='one';

Delete From Table Where Field='two';?

View Replies View Related

Splitting Time (00:00:00)

I have a variable that stores an amount of time in '00:00:00' format. It is a varchar in the database.

Is there a way to Split the value into hours, minutes, and seconds so I can add them?

I figure it would look something like

xx*60 + xx*60 + xx*3600? Or something like that?

View Replies View Related

Splitting A Querystring?

Has anyone had the misfortune to try and split a querystring that has x duplicate name/value pairs within the querystring? I have tried every sort of combination to do this and it continues to just run through the whole querystring.

here is an example querystring

URL

The Address values, email values, title values are fine as they are named on the previous page. The problem is, the L1, L2, L3, L4, L5 etc are dynamically named from a db depending on what the user selects on a previous page and can be duplicated up to 6 times, depending on how many different locations they have. I am able to get all the values at once, but need to be able to split the duplicated name/value pairs as they at seperate locations.

so what i need to be able to do is

Location 1

L1 - 0
L2 - 1
L3 - 0
L4 - 0
L5 - 0

Location 2

L1 - 0
L2 - 2
L3 - 2
L4 - 0
L5 - 0

View Replies View Related

Email Related Splitting

This is the code I have so far:

I take the email address and split at the "@" symbol. Then I split at the "." sign to get the firstname and lastname.

Most of the times, the email address is of the format:

FirstName.LastName@company.com

However at times, the email address can be just firstname@company.com

At such instances the code fails, how do I check for the instance of . before I split it again?

View Replies View Related

Splitting Characters With No Seperator?

basically what i have done is taken a date and time, split them apart, took the date array split that into 3 times via the / seperator now im trying to split the day number into 2.

(i.e if the day is 12 for example i want to split it so i get both 1 and 2 seperate, or if the day is 08 i would want to get 0 and 8 seperate).

Is there a way to split a number without some sort of seperator so i can get the first and second number of the day and if possible how?

View Replies View Related

Splitting Lines Of Code

if i wanted to split the below SQL statement on two lines, what would the
syntax be....

SQL = "UPDATE gallery WHERE g_id = " & Request.Form("g_id") &
"SET g_name = " &
Request.Form("g_name") &
"g_add = " &
Request.Form("g_add") "

View Replies View Related

Splitting Search String

I've made my first ASP website that interacts with a detabase. All fairly standard: it can display the entire contents of the db, you can input new items, update and delete items, and I've just started making a search page...[!]
It all works fine if the user just searches with one word, but if they enter more than one word and then press search, I don't know how to split their searchstring up into [an array of?] different strings to search the db with.
Is this even the easiest way to do it, or am I just wasting my time?

View Replies View Related

Splitting Text Into An Array

I need to split a large amount of text into an array
everytime there is an enter (meaning line down) what is the code for
the delimiter i would use..
Example text
Hello
This is some sample
text that needs to be put
into an array
by everytime
we go to the next line

sample code

Array = Split(sampletext,?)

View Replies View Related

Saving And Splitting Strings

I want to save a list of values in a cookie. I already use 1 key of the cookie to save the username. What I want to do is save a list of values as one string by using some kind of separator character.

There may be any number of these values including none. What is a good character to use to separate values? What commands do i use to split a string on the separator character into several strings?

View Replies View Related

Splitting Arrays With Sentences

I have an array I want to split. This is the code I am currently using:Code:

<%
dim aSelected
aSelected = split(request.form("option"),",")
for i = 0 to ubound(aSelected)
response.write (aSelected(i) & ("<br>"))
next
%>

This splits the array no problem. The problem I have is that the different variables (if thats the word to use?) the array is holding is sentences that contain commas in themselves. So the split is splitting my sentences. How can I split the variables at the end of the sentences. (some sentences have periods some don't so I can't use the ".").

View Replies View Related

Array And Splitting The Contents

This ASP page is a page which has FAQ. Some of the FAQ have answers with line breaks.

Questions and answers are stored in the database

When I output the answer, it displays like one long line. Hence I have written a small function to render this answer with line breaks where ever there are line breaks in this db field.

My code for the function is: ...

View Replies View Related

Splitting A Variable Into Parts

I have a variable named DressCode. The content of this variable is something like N040602
I want to split this variable into four parts:

DressCodea would be the N part
DressCodeb would be the 04 part
DressCodec would be the 06 part
DressCoded would be the 02 part

How do you do this is ASP, so it'll split the variable, no matter what the content is, as long as it is that format (ie 1 letter then 6 numbers).

View Replies View Related

Splitting Or Trimming A String

I am taking a field from a database and attaching it to avariable like so:

varID = rsCheckLogin("LogonID")

This is returning, for example, SA70.

I only need the integer part. How would i remove the SA part, i have belive it must be trim or split but not sure how to use them?

View Replies View Related

Splitting A VERY Long String

I have a very long string statement that needs spltting down into smaller sections and segments. I know how to use the split() function, and it splits the string down into smaller sections, however when I try and split one of these smaller sections into segments it throws an error out. Firstly is it possible to keep splitting the same string again and again to break it down? If not does anybody know how I would go about breaking down the string?

View Replies View Related

Splitting Text Fields

I am about to show a text field from SQL7.0 database, but need to display x number of images spread out amongst the text!! Basically similar to how bbc.co.uk/news display news articles....

I am wondering the best way to do this...

I was considering splitting the text into variables and then to display these sections next to the images.

Anyone else done this?

View Replies View Related

Splitting A String To Use Separate Words

i have a search form that will only search the whole string when
searching a query. i would like to have the search string split into
separate words so that each word could be used as part of a single
query. is there a simple solution to my question ?

View Replies View Related

Splitting String Containing Non Ascii Characters

I have these strings which are pulled from a database which contains both
english and chinese characters(big5).

e.g.

Fragrant Rice 10kg Green Dragon?
Broken Rice 10kg G.Elephant?

I want to split the string at the first occurance of the non ascii character so that i can get the english and chinese parts separated.

View Replies View Related

Splitting String Of Unicode Chars

i want to split a string containing unicode chars. If i use Split() funtion of ASP the unicode characters in string it gives wrong results..

Is there any other funtion or anyway through which i can split my unicode string to array?

HERE IS THE EXAMPLE FOR MY PROBLEM ------

i hav string in given form(sepated by a semi colon[;] )

ROOMS = Cap-Haitien;Gonaives;Jeremie;L’Artibonite;Grand-Gouave;

When i split this string using

Split(ROOMS, ";")

it gives me following results

Cap-Haitien
Gonaives
Jeremie
L’
Artibonite
Grand-Gouave

However it shud give me

Cap-Haitien
Gonaives
Jeremie
L’Artibonite
Grand-Gouave

Is there any solution to my problem?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved