General information
Title:
Access sql statement problem?
Environment versions
Database:
Jet/Access Engine
HI,ALL
Anyone know Access sql statement , use left join 3 tables, and group by , having sum function...
How can write to work, thx?
select distinct (c.candidate_no) FROM ((candidate as c left JOIN education as e ON c.candidate_no = e.candidate_no )
left Join working as w ON c.candidate_no = w.candidate_no )group by c.candidate_no
having sum(datediff('yyyy','01/01/' & w.from_year ,'01/01/' & w.to_year )) >= 1
tablename: Candidate
----------------------------------
candidate_id char(key)
candidate_no char
tablename: Education
----------------------------------
education_id char(key)
candidate_no char
tablename: Working
----------------------------------
working_id char(key)
candidate_no char
from_year int
to_year int
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only