codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  date format  missneg at 08:55 on Thursday, September 23, 2004
 

date format that asp returns is dd/mm/yyy bat when i want to build a query string to select from my db in sql server i have this error:
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

date format in sql is yyy/mm/dd;
plz help me,

  Re: date format  Yusairi at 12:02 on Friday, October 01, 2004
 

hi misneg,

try this ASP code :-

<%
Dim tempDate, tempMonth, tempDay, tempYear, tempStr

mDate = Date()

tempDate = REPLACE(tempDate, "/index.html", "")

tempMonth = LEFT(mDate, 2)
tempStr = LEFT(mDate, 4)
tempDay = RIGHT(mTemp, 2)

IF LEN(tempDate) = 8 Then
tempYear = RIGHT(tempDate, 4)
ELSE
tempYear = RIGHT(tempDate, 2)
END IF

tempDate = tempDay & "/index.html" & tempMonth & "/index.html" & tempYear

Response.Write(tempDate)
%>









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  JTable..
•  Re: import contacts of msn/yahoo
•  Re: Files
•  Re: Manipulating large Images.
•  Re: Replacing Class definition comments in java files
•  Re: Multiplication Problem
•  Re: Overlaying frames
•  Re: Array and Threads
•  Re: Compiling JAVA code in .NET?


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007