[AccessD] Updating DateTime Field IN SQL Server WithJust The Time

sgoodhall at comcast.net sgoodhall at comcast.net
Wed Oct 18 10:34:25 CDT 2006


Agreed.  More usefully, if you want to reference just the time portion of a stored datetime field, you can use the CONVERT function.

Regards,

Steve Goodhall

 -------------- Original message ----------------------
From: "Doris Manning" <mikedorism at verizon.net>
> Charlotte, I agree with you 100%.
> 
> Paul, the reason you are having problems is that SQL Server doesn't allow
> you to store just a time in a date/time field.  If you don't provide the
> date portion, SQL Server will fill in that portion with 1/1/1900.
> 
> Doris Manning
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
> Sent: Wednesday, October 18, 2006 11:00 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Updating DateTime Field IN SQL Server WithJust The
> Time
> 
> I don't understand what purpose is served by inserting only a time.
> Without a date, the time is pretty meaningless. 
> 
> Charlotte Foust
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> paul.hartland at fsmail.net
> Sent: Wednesday, October 18, 2006 7:00 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Updating DateTime Field IN SQL Server WithJust
> The Time
> Importance: High
> 
> Gustav,
> 
> Here's a test one I have been playing with, can't get more simple
> really....Even tried using CONVERT in the stored procedure and Format
> from Visual Basic 6.0 CREATE PROCEDURE [insert_timetable_1]
>  (@TestTime_1  [datetime])
> AS INSERT INTO [Genesis].[dbo].[timetable]
>   ( [TestTime]) 
>  
> VALUES
>  ( @TestTime_1)
> GO
> 
> The date is always 01/01/1900
> 
> Paul
> 
> 
> 
> 
> Message Received: Oct 18 2006, 01:44 PM
> From: "Gustav Brock" 
> To: accessd at databaseadvisors.com
> Cc: 
> Subject: Re: [AccessD] Updating DateTime Field IN SQL Server With Just
> The Time
> 
> Hi Paul
> 
> So what does your stored procedure look like?
> Which date is stored with the time? Today's date?
> 
> /gustav
> 
> >>> paul.hartland at fsmail.net 18-10-2006 13:51:46 >>>
> To all,
> 
> I have a little problem which I am sure this group can tell me the
> answer to....I have a datetime field in SQL Server 2000 I have an insert
> stored procedure which I pass the time to to put into the table, however
> it always puts the date in front of the time....I can input the time
> directly and no date gets put in front, I can also use a recordset with
> an update which works (but is slower)....Is there anyway I can insert a
> time into a datetime field in SQL Server 2000 without it putting the
> date in front using a stored procedure.
> 
> Thanks in advance for any help on this as it's driving me nuts.
> 
> 
> Paul Hartland
> paul.hartland at fsmail.net
> 07730 523179
> 
> 
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 
> 
> 
> 
> Paul Hartland 
> paul.hartland at fsmail.net 
> 07730 523179
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com





More information about the AccessD mailing list