Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
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 April 15th, 2004, 09:47 AM
Authorized User
 
Join Date: Nov 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inserting just the time segment

Hi,

I am passing some values into a stored proc from an ASP page, I am passing it in as a string in the format of

'00:00:00'

the problem is that it is addding the default date of 01/01/1900 during the insert. I have tried to use the convert function within the stored proc but it has not worked, this is probably more due to my code then the function. Below is the stored proc if you can tell me how to just pass in the time I would appeciate any help

CREATE PROCEDURE dbo.cnms_charges_update

    @BAND_START datetime,
    @BAND_END datetime,
    @ROW_ID INT= NULL

AS

BEGIN
SELECT CONVERT(char(8),@BAND_START,8)
SELECT CONVERT(char(8),@BAND_END,8)

    UPDATE charges SET

    BAND_START = @BAND_START,
    BAND_END = @BAND_END

    WHERE
        row_id = @ROW_ID

END
GO

many thanks
Peter

 
Old April 15th, 2004, 10:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I had to do this recently and found that if you set the date part to be 1899-12-30 then the field appears to just contain the time part.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Different color for a piechart segment ??? harifsheik C# 2005 3 July 30th, 2008 02:40 AM
Inserting Time Stamp into SQL testsubject ADO.NET 1 May 19th, 2006 07:14 AM
How can I set ROLLBACK SEGMENT of Oracle in SSIS? Samuel Choi SQL Server 2005 0 March 8th, 2006 04:55 AM
Inserting mulitible rows in one table at one time mohanrajb Classic ASP Databases 1 June 21st, 2005 10:09 AM
Stack segment fuehrer C++ Programming 1 April 29th, 2005 01:59 AM





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