Time operations

Results 1 to 2 of 2

Thread: Time operations

  1. #1
    Join Date
    Dec 1969

    Default Time operations

    I am trying to modify an asp page that records a specific time in a db. The time is created with the FormatDateTime(Now(), 3) method but seems to be stored in the db as a varchar. Theres another value stored in the db which is also a varchar but is a number between 1 and 24. What i need to do is subtract the second value from the time to show how much time is left. Do I need to change the datatype in the db?? Any ideas would be much appriciated.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Time operations

    Well, if you are storing a time in a db, you could use a datetime type and then ignore the date or use varchar <BR>and cast it to a date when you take it out.<BR><BR>Do you want to do this in your db or in ASP?<BR><BR><BR>in asp, i would take the times, add them onto todays date, cast them as dates<BR>CDATE(mydateandtime)<BR><BR>then do DateDiff on the two dates.<BR>

Posting Permissions

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