Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 14th, 2005, 05:34 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default date convert

Hi,
I have a field in my db called date.
it is in this short format ex.5/5/2005
Now I want to convert it to long format
I use this code
when i use this code it is ok
response.write formatDateTime(5/5/2005,vblongDate)

But when i use this code
strDate=2/2/2005
   response.write formatDateTime(" & strDate & ",vblongDate)
I get type mismatch error.

How can I use a variable to do this work?

 
Old May 14th, 2005, 04:41 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

how about?

dim strDate
strDate="2/2/2005"
response.write (formatDateTime(strDate,vblongDate))

 
Old May 15th, 2005, 01:02 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks very much it worked






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to convert string to date tgopal Javascript 2 March 18th, 2008 03:33 AM
convert date NARJES VB Databases Basics 1 May 22nd, 2007 01:02 PM
Convert Julian date motupally SQL Server 2000 3 July 5th, 2006 08:12 AM
Convert date to number samirz10 Access 1 July 22nd, 2005 03:04 PM
Convert String Date to Date for a SQL Query tdaustin Classic ASP Basics 4 July 7th, 2003 06:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.