What am i doing wrong

Results 1 to 2 of 2

Thread: What am i doing wrong

  1. #1
    bobby Guest

    Default What am i doing wrong

    Hi all this must be very easy but I cannot not seem to get my hear around it<BR><BR>I am new to the asp and data base programming I have manage to install an SQL server after playing around with logins <BR>I im trying to insert a record in to the date base as a time, the sql server has predefined fields like date time, small date time, which one should I use to insert the values for a 24 hours clock in the format of 1800 and what would it accept<BR><BR>Is this correct <BR>HH:MM:SS for date time <BR>HHMM for small date<BR><BR>How would the asp code look like I have seen things like # to be put around the insert statement im totally confused<BR>

  2. #2
    Garth Guest

    Default RE: What am i doing wrong

    datetime<BR>range: 1/1/1753 - 12/31/9999<BR>accuracy: one three-hundredth second<BR>size: two four byte integers<BR><BR>smalldatetime<BR>range: 1/1/1900 - 6/6/2079<BR>accuracy: minute<BR>size: two two byte integers<BR><BR>Use smalledatetime unless you need the added accuracy as it will save you space.<BR><BR><BR>The following works in Query Analyzer.<BR><BR>CREATE TABLE DateTest (f1 smalldatetime)<BR>go<BR>INSERT DateTest VALUES (&#039 1/1/00 18:00&#039)<BR>SELECT f1 FROM DateTest<BR><BR><BR>Simply build the string in your .asp and execute it.<BR><BR> <BR>Garth<BR>www.SQLBook.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts