当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - select fields from multiple tables with MSACCESS?

问题描述:

SELECT SignIn.VisitorFirstName As [First Name], SignIn.VisitorLastName As [Last Name], SignIn.SignInDateTime As [Sign In Time] FROM SignIn WHERE (((SignIn.[Complete])=No));

SignIn table also has a field called SignIn.PersonID

I have a PersonTable that has the following fields

ID - AutoNumber

First Name - Long Text

Last Name - Long Text

I need to get the Name (First and Last) from the PersonTable but using the Select Query I posted.

Not sure how I can accomplish this and I would appreciate it

网友答案:

Have you tried using a INNER JOIN Clause?

Something like this

SELECT 
      SignIn.VisitorFirstName As [First Name], 
      SignIn.VisitorLastName As [Last Name], 
      SignIn.SignInDateTime As [Sign In Time] 
      PersonTable.First,
      PersonTable.Last
 FROM SignIn 
 INNER JOIN PersonTable ON PersonTable.ID = SignIn.PersonID
 WHERE (((SignIn.[Complete])=No));
分享给朋友:
您可能感兴趣的文章:
随机阅读: