Author |
Topic |
|
kolucoms6
Average Member
845 Posts |
Posted - 19 April 2008 : 19:35:12
|
What the best way to save Time in Access ?
Like should i save it as text and then when I call the same in ASP, or Saving it as Time as DateTime format type ?
Preferable to save it as 24 hour format or 12 hour format ?
My purpose is to Update the Record with Call Back time and then a PopUp ( alwys On and querying db eveyr 15 mins ) will display that record if its within the range of current time.
|
|
MaD2ko0l
Senior Member
United Kingdom
1053 Posts |
Posted - 19 April 2008 : 21:21:18
|
i would use text to store the date/time as i have had issues when useing the DateTime format
i usually use the snitz function to change the date/time to hat i need it to be (StrToDate i think it is) |
© 1999-2010 MaD2ko0l |
|
|
kolucoms6
Average Member
845 Posts |
Posted - 19 April 2008 : 22:27:08
|
StrToDate is in which file ? |
|
|
MaD2ko0l
Senior Member
United Kingdom
1053 Posts |
Posted - 19 April 2008 : 22:34:36
|
inc_func_common.asp maybe? |
© 1999-2010 MaD2ko0l |
|
|
kolucoms6
Average Member
845 Posts |
Posted - 20 April 2008 : 14:23:37
|
My purpose is to Update the Record with Call Back time and then a PopUp ( alwys On and querying db eveyr 15 mins ) will display that record if its within the range of current time.
Any Suggestions on it ? |
|
|
gary b
Junior Member
USA
267 Posts |
Posted - 20 April 2008 : 17:14:35
|
Just a point to consider...
If time recorded as text, it is not easy to perform calculations. 1. Built-in functions (such as DiffDate) do not work on dates as text. 2. You cannot easily do a date compare, like: If DateAsText = Date() Then Do something Else Do nothing or do something else End If 3. Given a date, I can set a 'trigger' by calculating a future date... like callBackDate = registerDate + 14
Access will accept time in many formats. I normally use Short date -- such as 01/31008 -- and default value = Date(). If you need times, I use Now() -- both date and time. Set Access field format to date or time or both. Don't forget that date inputs in Access are indicated by # prefix/suffix, like #01/31/2008#.
I will use dates (that is, non-text values) whenever possible -- mainly because I use functions/calculations.
HTH some... |
|
|
kolucoms6
Average Member
845 Posts |
Posted - 20 April 2008 : 20:09:01
|
So, best way is :
1) Set Field datatype as Date/Time. 2) Save time as hh:mm:ss AM/pm 3) When Retrieving , Extract time from the field and compare time value with current time.
Is that so ? |
|
|
gary b
Junior Member
USA
267 Posts |
|
kolucoms6
Average Member
845 Posts |
Posted - 20 April 2008 : 21:54:26
|
My server displays PST time.
CBTime stores the time in PST also.
From DB , I want to retrieve records like
select col1,col2 from Table where CBTime between time() and dateadd("n",time,15)
Above query shld display all records where CBTime is next 15 minutes.
Right ?
Also, is it advisable to store time in 24 or 12 hour format ? |
Edited by - kolucoms6 on 20 April 2008 21:55:36 |
|
|
|
Topic |
|