473,503 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

working with dates

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

Jul 19 '05 #1
2 1894
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

Jul 19 '05 #2
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" <re*******@yahoo.com> wrote in message
news:eW**************@tk2msftngp13.phx.gbl...
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


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3318
by: Mad | last post by:
Hello to all. I have been trying to work with dates on Visual Basic Version 3. Using a Textbox (Text1.text) I understand that "Format" is use to display the date as you like. But what type...
2
4977
by: wireless200 | last post by:
I've got a table with some datetime fields in it. One field (call it field 1) is of the form mm/dd/yyyy and the other two (fields 2 and 3) are in the form of hh:mm:ss:xx where xx is hundreths of...
5
11353
by: tshad | last post by:
I have a date validation function that I want to stay at the object I am validating if there is a Validation error, but it always goes to the next object. The Javascript: function...
5
14870
by: BlackFireNova | last post by:
I need to write a report in which one part shows a count of how many total records fall within the working days (Monday - Friday) inside of a (prompted) given date range, in a particular...
3
3091
by: | last post by:
Hello, I am hoping someone else has thought about a date time calculation i need to perform. I would like to be able to calculate the number of "working minutes" between 2 dates, given my...
3
7713
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes...
12
3144
by: jonathan184 | last post by:
Hi the purpose of the script I am trying to do is to access a dir and run the ls -l command which will show the files and the modified date, no w the script is to check two files in that dir , if the...
11
2622
by: lenygold via DBMonster.com | last post by:
Hi everybody! This query is supposed to count consecutive years from the current year without OLAP. Input Table: ID DateCol 1 02/01/2006 1 01/01/2006 1 01/01/2005
6
2014
by: Mike Copeland | last post by:
I am working with a file of data that contains "time values" (e.g. "1225365563"), and I want to convert this data into something I can use in a program I'm developing. From what I've read about...
2
2779
by: angi35 | last post by:
Hi, I'm working in Access 2000. I have a form with a series of date fields, showing the progress of a project from start to completion. There's a set of fields/controls for projected dates (when...
0
7188
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7063
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
5558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.