Invalid query:
Unknown column 'g.ArchiveDateTime' in 'where clause'

Whole query:
select g.* from Groups g, GroupMembers gm where gm.LoginId = 5 and g.GroupId = gm.GroupId and g.ArchiveDateTime is null order by Rand() limit 0,3