Splitting a string into an array 
Author Message
 Splitting a string into an array

In an ASP in VBScript, I am working with a string that I want to send in an
SQL query as a date...

My question is this -- The user is typing in a six digit numeric date - ie
010101 for Jan 1, 2001. How can I convert this to a string in the following
format: 01/01/01 for use with an SQL query???

Thanks.

--
Steve Hodges, Jr.
DRG Marketing
8445 Castlewood Drive Suite A
Indianapolis, IN 46250

(317) 842-1619 (voice)
(317) 576-9304 (Fax)



Sun, 27 Oct 2002 03:00:00 GMT  
 Splitting a string into an array
something like this should work:
strDate = Request.Form("date") '  "010101"
strDate = Left(strDate, 2) & "/" & Mid(strDate, 3,2) & "/" & Right(strDate,
2)


Quote:
> In an ASP in VBScript, I am working with a string that I want to send in
an
> SQL query as a date...

> My question is this -- The user is typing in a six digit numeric date - ie
> 010101 for Jan 1, 2001. How can I convert this to a string in the
following
> format: 01/01/01 for use with an SQL query???

> Thanks.

> --
> Steve Hodges, Jr.
> DRG Marketing
> 8445 Castlewood Drive Suite A
> Indianapolis, IN 46250

> (317) 842-1619 (voice)
> (317) 576-9304 (Fax)



Sun, 27 Oct 2002 03:00:00 GMT  
 Splitting a string into an array
vardate = "010101"
wscript.echo Mid(vardate,1,2) & "/" & Mid(vardate,3,2) & "/" &
Mid(vardate,5,2)

Geert VC

Quote:
> -----Oorspronkelijk bericht-----

> Gepost om: woensdag 10 mei 2000 21:19
> Gepost naar: vbscript
> Discussie: Splitting a string into an array
> Onderwerp: Splitting a string into an array

> In an ASP in VBScript, I am working with a string that I want
> to send in an
> SQL query as a date...

> My question is this -- The user is typing in a six digit
> numeric date - ie
> 010101 for Jan 1, 2001. How can I convert this to a string in
> the following
> format: 01/01/01 for use with an SQL query???

> Thanks.

> --
> Steve Hodges, Jr.
> DRG Marketing
> 8445 Castlewood Drive Suite A
> Indianapolis, IN 46250

> (317) 842-1619 (voice)
> (317) 576-9304 (Fax)



Mon, 28 Oct 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. split string variable into array?

2. string splitting and arrays

3. Transfer Long String into split Array

4. Split function and String Array

5. how to split a split string

6. Best way to split string - mid() or split()?

7. String to Array and Array to String

8. Splitting arrays. X=split(split(y,"~"),"*") How Do i do this

9. BinaryRead - howto convert binary string back to string array

10. Split string by regular expression (ie. date)

11. Splitting Strings

12. String Split

 

 
Powered by phpBB® Forum Software