Tim-
Yes, you have to use DateDiff - both in Access and SQL Server with Datetime2 or Date. Fortunately, the ODBC driver converts the Access version of DateDiff to the SQL Server version just fine.
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 3, 2014, at 8:51 PM, <timdbui@gmail.com> <timdbui@gmail.com> wrote:
Thanks Bill and John for your replies!
Following Bill's instruction, I converted Access Date into SQL Server Datetime2(0). On final queries which are used for forms or reports, I formatted via Format([aaaa]![bbbb],"mm/dd/yyyy"), and it works.
For date calculation, Access' formula Now() - [Datethen] can not be converted into SQLServer. But when I use DateDiff(Date() - [Datethen]), and it works. It seems to me I have to use DateDiff for SQL Server, rather than just a simple subtraction as in Access.
Thanks again for helping all of us!
Tim
__._,_.___
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (13) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar