Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Converting string to datetime field


Message #1 by "Melinda Savoy" <msavoy@h...> on Tue, 24 Apr 2001 14:34:00
Thanks, I ended up using to_date.  I guess I was spoiled cause Sybase and MS
SQLServer take the date as a char.

-----Original Message-----
From: Gregory_Griffiths@c...
[mailto:Gregory_Griffiths@c...]
Sent: Tuesday, April 24, 2001 11:42 AM
To: javascript
Subject: [javascript] RE: Converting string to datetime field


you could use something like TO_DATE or TO_CHAR in your SQL to achieve 
this. You could alternatively provide dropdowns - one each for day, 
month and year -of numbers to allow the user to select the date from 
there.

> -----Original Message-----
> From: msavoy@h... [mailto:msavoy@h...]
> Sent: 24 April 2001 14:34
> To: javascript@p...
> Subject: [javascript] Converting string to datetime field
> 
> 
> I am not sure what method is easiest to convert a string to a 
> date type 
> field MM/DD/YYYY.  Here is what I am trying to do I have an ASP page 
> whereby the date text box field has a value of 
> <%=STRBIRTHDATE%>.  The 
> stored procedure I have written in SQL defines the field as 
> a "adDBTimeStamp" datatype field.  I created a variable 
> INTBIRTHDATE = 
> Request.Form("birthdate") which I am using in the my javascript code 
> below.  What I am trying to is to force the user to enter a 
> date in either 
> one of the following formats: MM/DD/YYYY or M/DD/YYYY or M/DD/YYYY or 
> M/D/YYYY and trying to ensure that he values the user entered 
> are numbers 
> and not alpha characters.  The error I am getting when I 
> enter a value 
> such as: 111361 and click the submit button is this:
> 
> 022537 (THIS IS THE VALUE I AM ENTERING THAT I AM TRYING TO 
> USE TO GET MY 
> JAVACRIPT TO LAUNCH) 
> ADODB.Parameter error '800a0d5d' 
> 
> Application uses a value of the wrong type for the current operation. 
> 
> /welcome_center/your_profile/wel_edit_physnods.asp, line 361 
> 
> 
> Any help would be appreciated.  Thank you.
>

  Return to Index