Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共7 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]标准表达式中数据类型不匹配

1楼
HANZHIGANG 发表于:2024/3/27 15:49:00

图片点击可在新窗口打开查看此主题相关图片如下:微信截图_20240327154219.png
图片点击可在新窗口打开查看
查询并加载数据时出现图片中的错误提示,内部表
怀疑是在导入数据时,原excel表中调度日期列的格式是代时、分、秒导致的,能不能实现在导入时,直接格式化调度日期列为只有
图片点击可在新窗口打开查看此主题相关图片如下:微信截图_20240327154140.png
图片点击可在新窗口打开查看
年月日的格式。

如果不是上面原因导致的,请另外指导一下
2楼
HANZHIGANG 发表于:2024/3/27 15:50:00
查询并加载数据时出现图片中的错误提示,内部表
怀疑是在导入数据时,原excel表中调度日期列的格式是代时、分、秒导致的,能不能实现在导入时,直接格式化调度日期列为只有年月日的格式。

如果不是上面原因导致的,请另外指导一下
3楼
有点蓝 发表于:2024/3/27 16:09:00
查询的代码?
4楼
HANZHIGANG 发表于:2024/3/27 16:10:00
Dim Filter As String

With e.Form.Controls("办事处")
    If .text > "" Then
        Filter = "办事处 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("VIN码")
    If .text > "" Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "VIN码 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("主机厂")
    If .text > "" Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "主机厂 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("承运单位")
    If .text > "" Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "承运单位 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("上游品牌")
    If .text > "" Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "上游品牌 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("车辆类型")
    If .text > "" Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "车辆类别 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("上游起点")
    If .text > "" Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "上游起点 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("上游终点")
    If .text > "" Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "上游终点 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("实际起点")
    If .text > "" Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "实际起点 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("实际终点")
    If .text > "" Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "实际终点 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("终点省份")
    If .text > "" Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "终点省份 like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("调起")
    If .value <> Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "调度日期 >= '" & .value & "'"
    End If
End With

With e.Form.Controls("调止")
    If .value <> Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "调度日期 <= '" & .value & "'"
    End If
End With

If e.Form.Controls("全段").text = "是" Then
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & "全段 = True"
End If

If e.Form.Controls("全段").text = "否" Then
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & "全段 = False"
End If

If e.Form.Controls("首段").text = "是" Then
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & "首段 = True"
End If

If e.Form.Controls("首段").text = "否" Then
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & "首段 = false"
End If

If e.Form.Controls("二次").text = "是" Then
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & "[二次<br>运输] = True"
End If

If e.Form.Controls("二次").text = "否" Then
    If Filter > "" Then
        Filter = Filter & " And "
    End If
    Filter = Filter & "[二次<br>运输] = False"
End If

If Filter > "" Then
    Tables("基础表").DataTable.loadfilter = Filter
    Tables("基础表").DataTable.load
Else
    Tables("基础表").DataTable.loadfilter = ""
    Tables("基础表").DataTable.load
End If
5楼
有点蓝 发表于:2024/3/27 16:16:00
内部表还是外部表?使用的什么数据库?
6楼
HANZHIGANG 发表于:2024/3/27 16:18:00
内部表
7楼
有点蓝 发表于:2024/3/27 16:20:00
日期要使用#号

Filter = Filter & "调度日期 >= #" & .value & "#"
共7 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .05273 s, 2 queries.