Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > working with dates

Reply
Thread Tools

working with dates

 
 
Brett Atkin
Guest
Posts: n/a
 
      08-18-2003
I have a form where I pass a member's end date to a processing page.

The date is getting passed as a string so when I try to add to that date I
get an error.

Here is my code - the error message is below the code.

********************

<%
sub_amount = request("sub_amount")
end_date = request("end_date")
mem_email = request.form("mem_email")
mem_first = request.form("mem_first")
mem_last = request.form("mem_last")
mem_ezine = request.form("mem_ezine")

Select Case sub_amount

Case "31.50"
sub_term = "One Year"
mem_status = "Current"
start_date = end_date + 1
end_date = start_date + 365

Case "53.00"
sub_term = "Two Years"
mem_status = "Current"
start_date = end_date + 1
end_date = start_date + 730

End Select
%>

********************

the error message.

********************
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "7/22/2003"]'
/powerquotes_plus/Connections/subscriptions.asp, line 14
********************

Question:

How do I convert the string date (end_date) to a format that I can work
with?

Thanks

Brett



 
Reply With Quote
 
 
 
 
Brett Atkin
Guest
Posts: n/a
 
      08-18-2003
Bob,

I knew that, I just couldn't it in my brain, I was drawing a blank. Thank
you for the quick answer.

It did help

Brett


"Bob Barrows" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Use CDate to convert the string to date.
>
> HTH,
> Bob Barrows
>
> Brett Atkin wrote:
> > I have a form where I pass a member's end date to a processing page.
> >
> > The date is getting passed as a string so when I try to add to that
> > date I get an error.
> >
> > Here is my code - the error message is below the code.
> >
> > ********************
> >
> > <%
> > sub_amount = request("sub_amount")
> > end_date = request("end_date")
> > mem_email = request.form("mem_email")
> > mem_first = request.form("mem_first")
> > mem_last = request.form("mem_last")
> > mem_ezine = request.form("mem_ezine")
> >
> > Select Case sub_amount
> >
> > Case "31.50"
> > sub_term = "One Year"
> > mem_status = "Current"
> > start_date = end_date + 1
> > end_date = start_date + 365
> >
> > Case "53.00"
> > sub_term = "Two Years"
> > mem_status = "Current"
> > start_date = end_date + 1
> > end_date = start_date + 730
> >
> > End Select
> > %>
> >
> > ********************
> >
> > the error message.
> >
> > ********************
> > Error Type:
> > Microsoft VBScript runtime (0x800A000D)
> > Type mismatch: '[string: "7/22/2003"]'
> > /powerquotes_plus/Connections/subscriptions.asp, line 14
> > ********************
> >
> > Question:
> >
> > How do I convert the string date (end_date) to a format that I can
> > work with?
> >
> > Thanks
> >
> > Brett

>
>



 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      08-18-2003
Use CDate to convert the string to date.

HTH,
Bob Barrows

Brett Atkin wrote:
> I have a form where I pass a member's end date to a processing page.
>
> The date is getting passed as a string so when I try to add to that
> date I get an error.
>
> Here is my code - the error message is below the code.
>
> ********************
>
> <%
> sub_amount = request("sub_amount")
> end_date = request("end_date")
> mem_email = request.form("mem_email")
> mem_first = request.form("mem_first")
> mem_last = request.form("mem_last")
> mem_ezine = request.form("mem_ezine")
>
> Select Case sub_amount
>
> Case "31.50"
> sub_term = "One Year"
> mem_status = "Current"
> start_date = end_date + 1
> end_date = start_date + 365
>
> Case "53.00"
> sub_term = "Two Years"
> mem_status = "Current"
> start_date = end_date + 1
> end_date = start_date + 730
>
> End Select
> %>
>
> ********************
>
> the error message.
>
> ********************
> Error Type:
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch: '[string: "7/22/2003"]'
> /powerquotes_plus/Connections/subscriptions.asp, line 14
> ********************
>
> Question:
>
> How do I convert the string date (end_date) to a format that I can
> work with?
>
> Thanks
>
> Brett



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RFC-822 dates into Ruby dates kellygreer1 Ruby 1 06-08-2008 10:59 PM
Need to use dates earlier than 1900 (Time library says out of range for dates < 1900) me@benjaminarai.com Ruby 1 07-17-2007 02:25 PM
FAQ Dates; Opera Dates. Dr J R Stockton Javascript 0 06-18-2007 03:51 PM
Dates dates dates dates... SQL and ASP.NET David Lozzi ASP .Net 1 09-30-2005 02:18 PM
Dates! Dates! Dates! PW ASP General 4 08-09-2004 04:42 PM



Advertisments