Help with Append Query

F

FJinSA

Hi Y'all, I am trying to run this append query but it does not run, am I
missing anything? Thanks for the help

INSERT INTO [Audit Table] ( OM, CSM, TB, UID, Start_Date, Login, Logout,
[Sch Start], [Sch Stop], [TCS Code], [HR Code] )
SELECT HR.WM_MGR_NAME_L8, [Sch Qry].CSM, [Sch Qry].TB, [Sch Qry].UID, [Sch
Qry].START_DATE, Format(LLO!Login,"Short Time") AS Login,
Format(LLO!Logout,"Short Time") AS Logout, [Sch Qry].[S Start], [Sch Qry].[S
Stop], [TCS Conv].[TCS Conv] AS [TCS Code], [Code Conv].Conv AS [HR Code]
FROM (([Sch Qry] INNER JOIN (HR INNER JOIN [Code Conv] ON HR.[HR TYPE] =
[Code Conv].[HR Code]) ON ([Sch Qry].UID = HR.UID) AND ([Sch Qry].START_DATE
= HR.Date)) INNER JOIN LLO ON ([Sch Qry].UID = LLO.UID) AND ([Sch
Qry].START_DATE = LLO.Date) AND (HR.UID = LLO.UID) AND (HR.Date = LLO.Date))
INNER JOIN [TCS Conv] ON [Sch Qry].[Seg Code] = [TCS Conv].[TCS Code];
 
J

John Spencer

INSERT INTO [Audit Table] ( OM, CSM, TB, UID, Start_Date, Login, Logout,
[Sch Start], [Sch Stop], [TCS Code], [HR Code] )
SELECT HR.WM_MGR_NAME_L8
, [Sch Qry].CSM
, [Sch Qry].TB
, [Sch Qry].UID
, [Sch Qry].START_DATE
, Format(LLO!Login,"Short Time") AS Login
, Format(LLO!Logout,"Short Time") AS Logout
, [Sch Qry].[S Start]
, [Sch Qry].[S Stop]
, [TCS Conv].[TCS Conv] AS [TCS Code]
, [Code Conv].Conv AS [HR Code]
FROM (([Sch Qry] INNER JOIN (HR INNER JOIN [Code Conv]
ON HR.[HR TYPE] = [Code Conv].[HR Code])
ON ([Sch Qry].UID = HR.UID) AND ([Sch Qry].START_DATE = HR.Date))
INNER JOIN LLO ON ([Sch Qry].UID = LLO.UID)
AND ([Sch Qry].START_DATE = LLO.Date)
AND (HR.UID = LLO.UID) AND (HR.Date = LLO.Date))
INNER JOIN [TCS Conv] ON [Sch Qry].[Seg Code] = [TCS Conv].[TCS Code];

Guessing that you might be getting an error on the Login and Logout fields. Are
the fields date/time fields. If so, you are trying to put strings into them.
The format function generates a string. If you just want the time portion of
LLO Login then use TimeValue function to return just the time.

"It does not run" is not very descriptive of the problem. If you are getting an
error message it helps to post the text of the error message.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

HELP! Please 1
append query SQL help needed 0

Top