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


ADVERTISEMENT

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 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 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 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

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

Splitting Multiple Tiffs Into Single Pages

How Can I extract multiple tiff images into single images through asp
programming?

Is there any free dll's that I can use in ASP to split multiple tiffs into
single tiffs?

View Replies View Related

Splitting Multi Select Item Into Arrays

I know that I can use instr(input,1) etc. but my attempts so far are of little use.

View Replies View Related

Createing Excel File Splitting Pages

I'm trying to make an excel sheet from my sql database that has all my Packing slips in one excel file. My problem is, ill get like 3 packing slips on one sheet. Is there anyway to do it so that it writes only 1 packing slip on each sheet of the excel file?

View Replies View Related

Splitting Awkward Strings And Posting To Access Table

I am creating for an MMORPG (Eve-Online) group a method of logging all ‘kills’ that they produce.

In game each player involved in a kill receives an ingame e-mail style notification as follows. I have set up a basic version whereby to log each mail a player just copys and pastes each bit of required data into individual form fields.

What I would like to set up is a system whereby they can just copy the entire mail into one form field and a script splits it up. I know this is possible as I have seen it on a competitor’s submission page (although they are using php).

I am using DW MX 2004 and using .asp VBscript pages connected by DSN (called dap) to an Access database (called killmail_Backup.mdb) I have an existing table called ‘killmail’ but I’ll probably create a new table for this. Code:

View Replies View Related

How To Check The Date Difference Between The Current Date And The Booking Date?

I am developing a simple booking system where I had a booking date. The problem is I want to make sure that the user must book 3 days in advanced for certain room.

I have tried to use DateDiff but it seems doesn't work. Actually i just 1 to make sure that the user must book 3 days in advanced from the current date. I am wondering whether there is anything goes wrong in my datediff function. Code:

View Replies View Related

Select Statement Comparing Date() & Date Field Of Database

i'm new here and i'd like to ask if there's someone who knows how to compare date() function and date from database with date/time type inside select statement so i don't have to do if..then..else

View Replies View Related

Date Problem (wrong Date Inserted When Updating)

sql = "UPDATE Marknad SET" _
& " Typ ='" & Typ & "'" _
& ", Modell ='" & Modell & "'" _
& ", Arsmodell ='" & Arsmodell & "'" _
& ", Beskrivning ='" & Beskrivning & "'" _
& ", Stad ='" & Stad & "'" _
& ", Prisidé ='" & Priside & "'" _
& ", Fornamn ='" & Fornamn & "'" _
& ", Efternamn ='" & Efternamn & "'" _
& ", Telefon ='" & Telefon & "'" _
& ", Epost ='" & Epost & "'" _
& ", Datum ='" & Datum & "'" _
& " WHERE (((Marknad.Annonsnr)=" & Request.QueryString("id") & "))"
DatabaseConnection.Execute sql

---

Above does work as I want it to do BUT it inserts 1/8/2006 instead of 8/1/2006 as it should!

The best thing would be to exclude the date from updating at all, but when taking away the line:

& ", Datum ='" & Datum & "'" _
It gives an error... how do I solve this?

I forgot, you might want to see this:
Datum = date

View Replies View Related







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