เปิดตาราง patient ที่สายฟ้า คลิกขวา แล้ว export เป็น excel หรือ dbf ก้ได้ แล้วไปนำเข้าที่access อีกที น่าจะได้นะคะ ![จุมพิต :-*](https://hosxp.net/smf2/Smileys/default/kiss.gif)
ใช้คำสั่งนี้นะครับ ดูเฉพาะรายที่มีเลขประชาชน เท่านั้น ไม่นับรายที่เป็น 111111111...หรือ 99999999999
และสามารถตรวจ HN ที่มีเลขประชาชน ซ้ำกันได้ด้วย
select distinct p1.cardno ,p1.hn,p1.expiredate,
p.pname,p.fname,p.lname as name,
p.birthday,p.fathername,p.mathername,p.hometel
from ptcardno p1
left outer join patient p on p.hn=p1.hn
where p1.cardtype='01'
and (p1.cardno <> '1-1111-11111-11-1' and p1.cardno <> '2-2222-22222-22-2'
and p1.cardno <> '3-3333-33333-33-3' and p1.cardno <> '4-4444-44444-44-4'
and p1.cardno <> '5-5555-55555-55-5' and p1.cardno <> '6-6666-66666-66-6'
and p1.cardno <> '7-7777-77777-77-7' and p1.cardno <> '8-8888-88888-88-8'
and p1.cardno <> '9-9999-99999-99-9' and p1.cardno <> '0-0000-00000-00-0')
order by p1.cardno,p1.hn