|
Home > Archive > IIS ASP > June 2004 > int to char ... date problem
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
int to char ... date problem
|
|
| Robin 2004-06-26, 10:18 am |
| I know that you would use cInt(n) to convert a string to an integer.
How do you convert an integer to a string?
I have a varChar field in a database that I am inserting a date field
(needs to be a char field).
The date is formatted like so:
y = year(now())
m = month(now())
d = day(now())
vNow = Y & "-" & M & "-" & D
To me this looks like it should come up with
vNow = 2004-6-25
But instead it is actually doing the math and coming up with
vNow = 1973
| |
| Dave Anderson 2004-06-26, 10:19 am |
| Robin wrote:
> I have a varChar field in a database that I am inserting a date
> field (needs to be a char field).
This makes no sense to me whatsoever. On one hand, it sounds as though you
want to convert a VARCHAR to a CHAR. That has nothing at all to do with ASP.
Beyond that, it is not clear if you are inserting a date (the abstract
notion of a date, that is) into a VARCHAR, or attempting to convert a
VARCHAR to a DATE.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
| |
| Aaron [SQL Server MVP] 2004-06-26, 10:19 am |
| > I know that you would use cInt(n) to convert a string to an integer.
> How do you convert an integer to a string?
CStr() ?
> I have a varChar field in a database that I am inserting a date field
What? You're inserting a date value into a VARCHAR column? WHY?
Is this Access, SQL Server, FoxPro, MySQL, ...? What version?
> But instead it is actually doing the math and coming up with
> vNow = 1973
Can you show the actual code that causes this to happen?
--
http://www.aspfaq.com/
(Reverse address to reply.)
|
|
|
|
|