Bill-
Well, I have a database that tracks scheduling of classes at a community college. The first date that the class is taught in a semester is in the Date field, and the time of day that the class convenes each day of the week it is scheduled is in the Time field. The time occurs on every day the class is taught, but the date indicates only the first date the class starts.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On Apr 2, 2014, at 9:44 PM, <wrmosca@comcast.net> <wrmosca@comcast.net> wrote:
John
Now you've piqued my interest. Why would you need to store time separately?
Bill
---In MS_Access_Professionals@yahoogroups.com, <JohnV@msn.com> wrote :
---In MS_Access_Professionals@yahoogroups.com, <JohnV@msn.com> wrote :
Tim & Bill-
I have one database table where the date and time need to be stored separately, so it was logical to use the separate date and time data types. One drawback to using date instead of datetime is you cannot do day arithmetic with date, as in date + 1 AS NextDay. You can do that with datetime just like you can in Access.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On Apr 1, 2014, at 11:04 PM, <wrmosca@comcast.net> <wrmosca@comcast.net> wrote:hi TimI don't know how many times the business rule started out "Oh, we only need the date, not the time." only to have it change down the road. With datetime, you can always format the outcome to show only the date.I don't recommend datetime2 unless you need that kind of accuracy (chasing atoms). Besides, if Access is your front end it can't see milliseconds.-Bill
---In MS_Access_Professionals@yahoogroups.com, <timdbui@gmail.com> wrote :Hi Bill,Would you please elaborate why you do not recommend the "date" function in SQL server and I should go for "datetime2(0)"?Thanks!Tim
__._,_.___
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (11) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar