如何返回两个日期之间的天数减去该时段的周六和周日的数量? mysql上的DATEDIFF函数为我提供了天数,但不排除周末。
例如,我有两列,并想添加第三列,这是两者之间的区别。
我将不胜感激。
答案 0 :(得分:1)
尝试使用此
声明@ Date1日期时间,@ Date2日期时间;
选择@ Date1 ='8/1/2018',@ Date2 ='8/7/2018'
选择Datediff(dd,@ Date1,@ Date2)-(Datediff(wk,@ Date1,@ Date2)* 2)- Datepart(dw,@ Date1)= 1然后1其他0 End +的情况 Datepart(dw,@ Date2)= 1然后1其他0结尾的情况
答案 1 :(得分:0)
The C compiler identification is GNU 5.1.0
The CXX compiler identification is GNU 5.1.0
Check for working C compiler: D:/Qt/qt-5.5.0-x64-mingw510r0-seh-rev0/mingw64/bin/gcc.exe
Check for working C compiler: D:/Qt/qt-5.5.0-x64-mingw510r0-seh-rev0/mingw64/bin/gcc.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: D:/Qt/qt-5.5.0-x64-mingw510r0-seh-rev0/mingw64/bin/g++.exe
Check for working CXX compiler: D:/Qt/qt-5.5.0-x64-mingw510r0-seh-rev0/mingw64/bin/g++.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Could NOT find GDB (missing: GDB_VERSION)
Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found suitable version "1.8.14", minimum required is "1.8.6")
CMake Error at C:/Program Files/CMake/share/cmake-3.8/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.8/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.8/Modules/FindPythonInterp.cmake:149 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:353 (FIND_PACKAGE)
Configuring incomplete, errors occurred!