爱问知识人 爱问教育 医院库

有个VB中多表查询语句写错了,请各位大侠帮帮忙!

首页

有个VB中多表查询语句写错了,请各位大侠帮帮忙!

Adodc1.RecordSource = "select DISTINCT bookJy.姓名,personal.班级,personal.部门,personal.职称 from bookJy left join personal left join type on bookJy.借书证号=personal.借书证号 on bookJy.类别=type.类别 where  DateDiff("D", bookJy.借出日期, Format(Now, "yyyy-m-dd"))>type.借出天数"

我想求出过期未还书的人员的姓名,班级,部门和职称,错误好像在where的条件语句,拜托大家帮帮忙,
谢谢大家了!!!!

提交回答
好评回答
  • 2008-05-14 19:31:43
    Adodc1.RecordSource = "select distinct bookJy.姓名,personal.班级,personal.部门,personal.职称 from personal right join (bookJy left join type on bookJy.类别=type.类别) on personal.借书证号=bookJy.借书证号 where DateDiff( " & Chr(34) & "D" & Chr(34) & ", bookJy.借出日期, Format(Now," & Chr(34) & "yyyy-m-dd" & Chr(34) & "))>type.借出天数"

    芷***

    2008-05-14 19:31:43

其他答案

    2008-05-14 12:04:23
  • select DISTINCT A.姓名,B.班级,B.部门,B.职称 
    from bookJy A left join personal B on A.借书证号=B.借书证号 
    left join type C on A.类别=C.类别 
    where DateDiff(DD, A.借出日期, getdate())>type.借出天数
    以上是SQL语句,不用format的,只是用来计算的,另外sql每月NOW这个函数的
    Access数据库的稍等吧,我写的是sqlserver的

    下***

    2008-05-14 12:04:23

类似问题

换一换
  • VB 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 172-191
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):