Table Updating issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry Maiapu
    Contributor
    • Feb 2010
    • 259

    #1

    Table Updating issue

    Ok I have this table:Trialdate and query: Absentdays.

    Now I want to update column values of table Trialdate from column values of Absentdays Where the dates are equal.

    So far this is what I did but could not get any further than that..

    Code:
    UPDATE Trialdate 
    SET CLockin =Absentdays.TimeIn
    FROM  Absentdays
    Where Trialdate.InsertedDates=Absentdays.DateWorked;
    I am prompt with "Syntax Error (Missing operator)"

    Is there any other better way of going around this?
    Or am I missing something?

    I have tried many options so far and this is last before actually looking at other options like.. using recordset in VB.. I just want to confine it to Query level..
  • Jerry Maiapu
    Contributor
    • Feb 2010
    • 259

    #2
    I found out myself but if someone has tried to assist then i appreciate your concerns..

    Code:
    SELECT Trialdate.InsertedDates, 
    IIf(IsNull([TimeIn]),"Absent",[TimeIn]) AS ClockIn,
    IIf(IsNull([TimeOut]),"Absent",[TimeOut]) AS ClockOuts
    FROM Trialdate
    LEFT JOIN Absentdays
    ON Trialdate.InsertedDates = Absentdays.DateWorked
    WHERE ((Weekday([InsertedDates],2)<6));[I]'filter to display b/hours only[/I]

    Comment

    Working...