'search for crjsj data and Personnel Data whose names are 'xx Ms' or whose card number is 99999999 or number is 'sn. '
select crjsj. ID, rszl. BH, crjsj. KH, rszl. XM, crjsj. time8, crjsj. date8, crjsj. mjbh, crjsj. mjkzqbh, crjsj. syqk, crjsj. crjqk
from crjsj right join rszl on crjsj. kh = rszl. kh
where
crjsj. kh = 99999999
or
crjsj. kh = (select KH from rszl where XM = 'xxx 'and DELE = 0)
or
crjsj. kh = (select KH from rszl where bH = 'No.' And DELE = 0)
and date8 between #2005-1-26 # And #2005-7-26 #
; --------------------------------------------------------------------
select. ID, B. BH,. KH, B. XM,. date8,. time8 from crjsj A, rszl B where
. kh = B. kH and
(. kh = 1 or
. kh = (select top 1 KH from rszl where XM = 'xxx 'and DELE = 0) or
. kh = (select top 1 KH from rszl where bH = 'No.' And DELE = 0)
) and
. date8 between #2005-7-26 # And #2005-7-26 #
; --------------------------------------------------------------------