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 January 19th, 2005, 12:57 PM
Authorized User
 
Join Date: Dec 2004
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need dire help with dates!!

Need to convert courtdate variable to CDBL type. If anybody has an idea please point me in the right direction.

<----- CODE ----->
courtdate = Request.QueryString("crtdate")

ctdate = cdbl(courtdate)<---------- this is not working right now.

Set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "Provider=SQLOLEDB;Data Source=acnt4;Initial Catalog=diary;User Id=sa;Password=;"
objConn.Open strConnection

Set objRs = Server.CreateObject("ADODB.Recordset")
Set objRs.ActiveConnection = objConn

Sql = "SELECT dte, eTime, cnumber, text_field, defatty, etype "
Sql = Sql & "FROM diary "
Sql = Sql & "WHERE dte= '" & dt & "' "
objRs.Open Sql, objConn

Mike
__________________
Mike
 
Old January 19th, 2005, 01:23 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cdbl(expression) Your expression should be numeric or something (not a string) that can be cast to a number.

This works
<%
Response.Write Cdbl(Now())
%>

but, This should not work
<%
Response.Write Cdbl("01/18/2005")
%>





Similar Threads
Thread Thread Starter Forum Replies Last Post
dates again dhoward VB.NET 2002/2003 Basics 12 August 22nd, 2007 09:48 AM
dates DARSIN General .NET 4 January 14th, 2005 09:09 AM
between dates capitala Access VBA 1 May 30th, 2004 05:20 PM
Dates treadmill SQL Language 3 July 3rd, 2003 02:32 PM
Dates oathamm Servlets 1 June 27th, 2003 05:43 AM





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