English 中文(简体)
管治 将参数值作为选定记录之一
原标题:MS Access Query - Use a parameter value as one of the selected records

我正在撰写一份带有参数的MS Access Query,并想知道是否有可能将一个参数作为已归还的部分记录:

PARAMETERS [@SubmissionID] IEEEDouble, [@StartDate] DATETIME, [@EndDate] DATETIME;
INSERT INTO tblHUD_client_profile
(SubmissionID, ClientID)
SELECT [@SubmissionID] as SubmissionID, DISTINCT(ClientID) 
FROM tblClientEducation
WHERE (BeginDate BETWEEN [@StartDate] AND [@EndDate]
   OR EndDate BETWEEN [@StartDate] AND [@EndDate])
   AND NOT EXISTS(
                  Select ClientID 
                  from tblHUD_client_profile 
                  WHERE SubmissionID = [@SubmissionID] 
                  AND ClientID = tblClientEducation.ClientID
                  );

“Select [@SubmissionID] as SubmissionID”总能给我一个yn子错误。

我抱歉,如果已经从那里找到这一解决办法的话。 我对这一点进行了研究,但是,在涉及“MS Access Queries”和“参数”的诸多基本问题上,我无法找到我所期待的东西。

最佳回答

After reviewing the original code, it seems to work as expected.

问题回答

离开@MS Access:

PARAMETERS SubmissionID Integer;
SELECT [SubmissionID] as SubmissionID, DISTINCT(ClientID) 
FROM tblClientEducation




相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

access query to filter and combine count

i have two access tables tableA num count 1 7 2 8 3 9 4 9 5 13 6 6 tableB num count 0 1 1 14 2 12 3 5 4 5 5 11 6 5 how can i create an access query that ...

How to show File Picker dialog in Access 2007?

I want to show a dialog where the user can pick a file, click OK, and then the path to the file will be saved in the database. I have just one problem, I can t figure out how tho show the dialog ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

Returning row number on MS Access

I have 4 tables, from which i select data with help of joins in select query...I want a serial no.(row number) per record as they are fetched. first fetched record should be 1, next 2 and so on... In ...

热门标签