Inserting Time to a SQL Database

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Inserting Time to a SQL Database

    I'm builidng a program that requires me to record the time of day that a
    department physcially receives a document and then when it leaves the
    department. I also need to write a report that would subtract the report
    ultimately saying that this document was in this department for 45 minutes or
    10 hours. So my insert screen needs to be able to accept a manual entry of
    time. I can't find a data type that seems to support this. I keep getting
    errors. What am I missing? I'm using vbscript and a SQL server.

    webgirljudi Guest

  2. Similar Questions and Discussions

    1. inserting time
      IS THERE A WAY TO INSERT A FIELD WHERE THE CURRENT TIME WILL BE DISPLAYED EACH TIME A PERSON ACCESS THE SITE????? PLZ HELP!!!!!!!!!!
    2. Inserting both date AND time into one timestampcolumn
      Function parsedatetime() will allow you to return a datetime object by combining a date and time string: <cfset dte="jan 22, 2005"> <cfset...
    3. Inserting and Updating Records at the same time
      Hi, Ive created a form which inserts a record into one table within the database, but i also need it to increment a field in another table of the...
    4. inserting the time into database
      hi i have a page where all the stories are displayed, ordered by colomn "date" descsending. the problem is that if two stories are enter on the...
    5. Inserting a time-out into a movie
      I'm creating a touchscreen game and want to insert a time-out whereas if the game is left halfway through for a certain amount of time it will go...
  3. #2

    Default Re: Inserting Time to a SQL Database

    In your Date/Time field in your SQL table you can use the default of Getdate()
    which will stamp with the Date and Time that record is created.
    When you want to update, this will not work, but you can use Now() in a hidden
    field on the ASP page to insert the Date and Time to a field in your DB.

    Originally posted by: webgirljudi
    I'm builidng a program that requires me to record the time of day that a
    department physcially receives a document and then when it leaves the
    department. I also need to write a report that would subtract the report
    ultimately saying that this document was in this department for 45 minutes or
    10 hours. So my insert screen needs to be able to accept a manual entry of
    time. I can't find a data type that seems to support this. I keep getting
    errors. What am I missing? I'm using vbscript and a SQL server.



    CarlGrint Guest

  4. #3

    Default Re: Inserting Time to a SQL Database

    The getdate() won't work - it's a manual entry. If I received physcial paper
    on my desk at 8:00 and don't get to work on it until 10:00. When I enter my
    time into this app I need to note both the 8:00 receive time the 10:00 start
    time and the say 10:30 finish time. The folks using this program may not enter
    the data until they are finished or may record it on paper and transfer it to
    the program at the end ot the day. Therefore, I need 3 date/time stamps that
    are manual. Does this make sense?

    webgirljudi Guest

  5. #4

    Default Re: Inserting Time to a SQL Database

    Then all you need are the three columns in your database, set to Date/Time
    format, then add in fields to your form to take the Times, giving the
    approparate titles to ensure your user enters the Time in the correct field.

    Originally posted by: webgirljudi
    The getdate() won't work - it's a manual entry. If I received physcial paper
    on my desk at 8:00 and don't get to work on it until 10:00. When I enter my
    time into this app I need to note both the 8:00 receive time the 10:00 start
    time and the say 10:30 finish time. The folks using this program may not enter
    the data until they are finished or may record it on paper and transfer it to
    the program at the end ot the day. Therefore, I need 3 date/time stamps that
    are manual. Does this make sense?



    CarlGrint Guest

  6. #5

    Default Re: Inserting Time to a SQL Database

    makes sense, but forgive me, how do I ensure they enter it correctly? Does dreamweaver have an error trapping thing I can add to these fields?
    webgirljudi Guest

  7. #6

    Default Re: Inserting Time to a SQL Database

    You want to use the Yaromat form checker extension, that gives you the option
    to ensure a Time is entered, although as with all it is Javascript based, so
    you need to ensure Javascript is on.

    Alteratively you can write an ASP checker which ensures the form data is
    correct before entering into db.

    [url]http://www.yaromat.com/dw/?ex=Check%20Form%20MX[/url]

    Originally posted by: webgirljudi
    makes sense, but forgive me, how do I ensure they enter it correctly? Does
    dreamweaver have an error trapping thing I can add to these fields?



    CarlGrint Guest

  8. #7

    Default Re: Inserting Time to a SQL Database

    Thank you, thank you!!
    webgirljudi Guest

  9. #8

    Default Re: Inserting Time to a SQL Database

    i still must be missing something. I'm still getting the same error.

    Incorrect syntax near ':'

    it won't take the colon. I'm using an internal SQL server with the datetime type, 8 as the length
    webgirljudi Guest

  10. #9

    Default Re: Inserting Time to a SQL Database

    It is possible that the database expects 18:03:10 and you are feeding 18:03 so
    this may be a problem.

    Depending on your requirements, you could always do away with the Date/Time
    format, and use a varchar field to store the time.

    It depends if you wish to carry out calculation on the Times saved.

    Originally posted by: webgirljudi
    i still must be missing something. I'm still getting the same error.
    Incorrect syntax near ':' it won't take the colon. I'm using an internal
    SQL server with the datetime type, 8 as the length



    CarlGrint Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139