• sqlite 数据库 时间函数及示例


    .如果真 (组合框2.现行选中项 = 0)  ' 指定时间范围
        局_Sql语句 = 局_Sql语句 + “datetime('” + startDate + “','start of day') and tk_create_time < datetime('” + endDate + “','start of day')”
    .如果真结束
    .如果真 (组合框2.现行选中项 = 1)  ' 今天
        局_Sql语句 = 局_Sql语句 + “DATETIME ('now','start of day','+0 day')  and tk_create_time < DATETIME ('now','start of day','+1 day')”
    .如果真结束
    .如果真 (组合框2.现行选中项 = 2)  ' 昨天
        局_Sql语句 = 局_Sql语句 + “DATETIME ('now','start of day','-1 day') and tk_create_time < DATETIME ('now','start of day','+0 day')”
    .如果真结束
    .如果真 (组合框2.现行选中项 = 3)  ' 本周
        局_Sql语句 = 局_Sql语句 + “DATETIME ('now','start of day','-6 day','weekday 1') and tk_create_time < DATETIME ('now','start of day','+1 day','weekday 1') ”
    .如果真结束
    .如果真 (组合框2.现行选中项 = 4)  ' 本月
        局_Sql语句 = 局_Sql语句 + “DATETIME ('now','start of month','+0 month','-0 day') and tk_create_time < DATETIME('now','start of month','+1 month','0 day')”
    .如果真结束
    .如果真 (组合框2.现行选中项 = 5)  ' 上月
        局_Sql语句 = 局_Sql语句 + “DATETIME ('now','start of month','-1 month','-0 day') and tk_create_time < DATETIME ('now','start of month','+0 month','-1 day')”
    .如果真结束
    .如果真 (组合框2.现行选中项 = 6)  ' 今年
        局_Sql语句 = 局_Sql语句 + “DATETIME ('now','start of year','-1 year','-0 day') and tk_create_time < DATETIME ('now','start of year','+0 year','-1 day')”
    .如果真结束
    

      

  • 相关阅读:
    乱七八糟
    堆-heap
    转linux文件的读写
    @转EXT2->EXT3->EXT4
    (转)僵死进程与孤儿进程
    java
    poj-1062-昂贵的聘礼
    java 之 wait, notify, park, unpark , synchronized, Condition
    事物(笔记)
    BPX-tree
  • 原文地址:https://www.cnblogs.com/zbl3033/p/12864111.html
Copyright © 2020-2023  润新知