I want to make a search today and use the time comparison function! In the past, it was usually a direct comparison time, and the query statement was not highly efficient ~~~ Later, I used the DateDiff function and found some problems during debugging. I would like to summarize some of the issues with mongo_^ 1 and the database. The Access and SQL read time functions are different. Now () only allow
I want to make a search today and use the time comparison function! In the past, it was usually a direct comparison time, and the query statement was not highly efficient ~~~ Later, I used the DateDiff function and found some problems during debugging. I would like to summarize some of the issues with mongo_^ 1 and the database. The Access and SQL read time functions are different. Now () only allow
I want to make a search today and use time comparisonFunction!
In the past, it was usually a direct comparison time, and the query statement was not highly efficient ~~~
Later, DateDiff was used.FunctionI found some problems during debugging. I would like to summarize some of them and share them with you. ^_^
1. Database problems, Access and SQL read timeFunctionDifferent, Now () can only be used in Access, and GetDate () can only be used in SQL ()FunctionTo obtain the system time.FunctionFor example, Time (). You should pay attention to it during debugging.
2. It is DateDiff ('D', Time1, Time2). At the beginning, I found thisFunctionHow can I debug SQL statements that fail frequently? Why can't I use SQL statements that can be used in ACCESS ~~~
But then I went to the Internet to search and found thatDifferences~~~
Specifically:
Access: DateDiff ('D', Time1, Time2)
SQL: DateDiff (d, Time1, Time2)
Note that quotation marks are not required in SQL.
The following is your own DateDiff.FunctionSQL query statements written
Select PigID, PigName, RingNum, Sex, PigOwner, PostDate, Passed FROM HZ_Pig Where DateDiff (m, 'shoottime', PostDate) <= 0
The specific function is not mentioned. Many people on earth know it!
Hey, hope you can help me ~~~~~