Hello and thank you again for the assistance.
I am running the code below and it is returning back the desired results that I want:
However, when I add the following, an error throws that says invalid use of null:
The query is fixed when I do this:
My question is..why is this? Why does the query work the first time without the Nz and not work the second time when I have Nz only on d.Code. Why do I have to put Nz on everything?
There is no null values that I see exist in the tables for the records.
Thank you!
Kind Regards,
I am running the code below and it is returning back the desired results that I want:
Code:
SELECT ProjectId, d.Code,WeekStart,Hours,NOW() AS RecordDate
FROM ((tmpSparkleActualsByDisciplinekntv a
LEFT JOIN Discipline d
ON a.Discipline = d.DisciplineName)
LEFT JOIN Project p
ON a.Project = p.ProjectName)
WHERE CStr(ProjectId) +Cstr(Hours)
IN (SELECT CStr(ProjectId) + CStr(Amount) FROM ActualHours)
However, when I add the following, an error throws that says invalid use of null:
Code:
SELECT ProjectId, d.Code,WeekStart,Hours,NOW() AS RecordDate
FROM ((tmpJacobsActualsByDisciplinekynw a
LEFT JOIN Discipline d
ON a.Discipline = d.DisciplineName)
LEFT JOIN Project p
ON a.Project = p.ProjectName)
WHERE CStr(ProjectId) +Cstr(Hours) +CStr(Nz(d.Code,''))
IN (SELECT CStr(ProjectId) + CStr(Amount) +CStr(Nz(DisciplineCode,'')) FROM ActualHours)
The query is fixed when I do this:
Code:
SELECT ProjectId, d.Code,WeekStart,Hours,NOW() AS RecordDate
FROM ((tmpJacobsActualsByDisciplinekynw a
LEFT JOIN Discipline d
ON a.Discipline = d.DisciplineName)
LEFT JOIN Project p
ON a.Project = p.ProjectName)
WHERE CStr(Nz(ProjectId,'')) +Cstr(Nz(Hours,'')) +CStr(Nz(d.Code,''))
IN (SELECT CStr(Nz(ProjectId,'')) + CStr(Nz(Amount,'')) +CStr(Nz(DisciplineCode,'')) FROM ActualHours)
My question is..why is this? Why does the query work the first time without the Nz and not work the second time when I have Nz only on d.Code. Why do I have to put Nz on everything?
There is no null values that I see exist in the tables for the records.
Thank you!
Kind Regards,