ASP SQL Server 2000 Date/Time Formating

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Chad S (webaccess_at_hotmail.com)
Date: 02/20/04


Date: Fri, 20 Feb 2004 09:48:51 -0800

Hello,

I have two questions which I would appreciate some help with.

1. Date Formating when Inserting into SQL Server 2000
I'm currently passing YYYYMMDD into a datetime field. When I look at
the database it is in the format MM/DD/YYYY. However, if the date is
20040303 it's inserted as 3/3/2004. How do I keep the zero's in the
date when inserting into the database ?

2. Time Formating when Inserting into SQL Server 2000
I'm trying to insert military time to a datetime field. Is there a way
to format this in the database ? I've only had success using hh:mm
AM/PM. I only want to use military time.

Thank you so much !

Chad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: ASP SQL Server 2000 Date/Time Formating
    ... Date Formating when Inserting into SQL Server 2000 ... >I'm trying to insert military time to a datetime field. ... as any particular format. ...
    (microsoft.public.inetserver.asp.db)
  • Re: The data was added to the database but the data wont be displayed
    ... replication with queued updates (SQL Server 2005), ... When inserting records into a Microsoft SQL Server database from an ... Microsoft Access tries to reselect the newly inserted record to ... subscriber) are SQL Server 2000. ...
    (microsoft.public.access.adp.sqlserver)
  • RE: Updateable views and identity/default columns
    ... Microsoft® SQL Server™ 2000 Windows® CE Edition. ... The column list and VALUES list must be used when inserting explicit values ... into an identity column. ... Columns created with the uniqueidentifier data type store specially ...
    (microsoft.public.sqlserver.programming)
  • Re: Very serious bug with Materialized/Indexed views and SQL server
    ... Although MS does frequent this newgroup there is no guarentee they will see ... > Do not trust values returned by materialized views under SQL Server ... > inserting lots of data into our two main tables for about 30 minutes, ... > view synchronize!?!!?! ...
    (microsoft.public.sqlserver.programming)
  • Re: @@Identity
    ... How Does SQL Server Manage Identity Values? ... When you add a row to a table with an Identity column you don't include a ... A scope is a module -- a stored procedure, trigger, function, or ... > If you are inserting a row with your ADO.Net code that will increment the ...
    (microsoft.public.dotnet.framework.adonet)