Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
| Search | Today's Posts | Mark Forums Read
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP 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 September 21st, 2004, 03:37 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Date parameter problem

I keep getting errors when I try to use this SP. I am passing it two form date values and there seems to be a date conversion problem. Any suggestions would be great.

----------------------------

alter PROCEDURE Downtime_TotalOutages
@startdate smalldatetime,
@enddate smalldatetime

AS
SELECT COUNT(*) AS Count
FROM DownTimeEvent
WHERE
Event_Date >= @StartDate AND
Event_Date <= @EndDate

 
Old September 22nd, 2004, 07:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

What error are you getting?

Brian
 
Old September 22nd, 2004, 08:09 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Hopw are you setting the parameters, the safest way is either pass an unambiguous string '1 Jul 2004' or 6 character yyyymmdd => 20040701.

--

Joe
 
Old September 22nd, 2004, 12:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You will have to pass those values without the TIME part in it(as Joe suggested), to get that work. It is always better to post the error here, to understand better on what the problem is.

Cheers!

_________________________
- Vijay G
Strive for Perfection




Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Parameter in a Union Query bright_mulenga Access VBA 0 January 17th, 2008 03:52 AM
problem with the parameter date in a mdx query olmouy SQL Language 0 May 30th, 2007 05:32 AM
Adding Date parameter joeri BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 3 March 9th, 2007 03:50 PM
Passing a Date Parameter ego_mouse BOOK: Professional Crystal Reports for VS.NET 1 January 27th, 2005 08:12 AM
Passing Date Parameter jmss66 VB How-To 4 April 28th, 2004 03:02 PM





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