int to char ... date problem
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > int to char ... date problem




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    int to char ... date problem  
Robin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 03:18 PM

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





[ Post a follow-up to this message ]



    Re: int to char ... date problem  
Dave Anderson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 03:19 PM

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.







[ Post a follow-up to this message ]



    Re: int to char ... date problem  
Aaron [SQL Server MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-04 03:19 PM

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








[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:40 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register