StrSql = "select 17931client.* from 17931client join 17931order on (17931client.cInstallPhone = 17931order.cInstallPhone) where 17931order.dDatetime >= #" & Trim(Combo2.Text) & "-" & Trim(Combo1.Text) & "-1# And 17931order.dDatetime <= #" & Trim(Combo2.Text) & "-" & Trim(Combo1.Text) & "-31#"其中combo2.text获得年份,combo1.text获得月份,即查询条件为工单表中某年某月的所有客户表中的资料

解决方案 »

  1.   

    try:
    StrSql = "select 17931client.* from 17931client join 17931order on (17931client.cInstallPhone = 17931order.cInstallPhone) where 17931order.dDatetime >= " & DateSerial(Trim(Combo2.Text), Trim(Combo1.Text), 1) & "And 17931order.dDatetime <= " & DateSerial(Trim(Combo2.Text), Trim(Combo1.Text), 31)
      

  2.   

    请解释一下好吗?? 17931client.*  这是什么意思!!!?
      

  3.   

    17931client是一个表的名字,
    .*是17931client表的全部字段名
      

  4.   

    TO:        northwolves(野性的呼唤) 用了你的语句还是提示"from字句语法错误"
      

  5.   

    try:
    StrSql = "select 17931client.* from 17931client join 17931order on (17931client.cInstallPhone = 17931order.cInstallPhone) where 17931order.dDatetime >= #" & DateSerial(Trim(Combo2.Text), Trim(Combo1.Text), 1) & "# And 17931order.dDatetime <= #" & DateSerial(Trim(Combo2.Text), Trim(Combo1.Text), 31)&"#"