database - finding records in a table where there is at least one record in a linked table with a date field of no longer than 3 moths from now() -


We have a project database in MSACCESS with the following tables: An ID and project descriptions with table projects. Comments with table, an id, a date and a comment text field.

Comments are linked to projects with a lot of relationships (a project can have many comments)

What I want is a query that is less than 3 months old Selects all projects with at least one comment with date.

I tried to enter an internal entry and found the filter properly, but I thought I could filter doubles with specific or specific, but the MSAC cess would not accept the syntax.

This is an easy task that will be easy to do in any programming environment, but I can not get it in a single question ...

[Update]: I have A little extra question: Records can be shown with at least one comment, and we do not want to show new projects (with any comments yet) I date ("M", -3, DATE ()) and Between DATE ()) a

  "or count (on select project) Where to try to add comments (comment.commentdate)) = 0    

Since you want different projects but there is no related comment data, there are several ways to accomplish this.

Connect separately to the left

  different - Select different projects. Leave projects in projects on projects. Comments.projectid Dataid ("M", -3, DATE ()) and DATE ()) between WHERE ((comments.commentdate) or comments) Projectid is empty   

Join the left group

  SELECT projects.id, projects.fielda, [....] Leave a comment on projects from projects .id = comments.projectid WHERE (Comments (comment.commentdate) between Dataid ("M", -3, DATE ()) and DATE ()) or comments.projectid Null Group Projects, Projects Field, [....]    

Existing rules Select

  from where projects are present (comments from * selection * where (comments.commentdate) dateized ("M", -3, DATE ()) and DATE () and (projects.id = comments. Projectid)) or not (comments from the selection * where projects.id = comments.projectid)   

INNER join an interval view that connects to a joint jointly

  Join projects from SELECT * (Select from a different project from the selection, comments from comments on projects (comment (comment.com Mentdate comment (comment) on date ("M", "M", -3, DATE ()) and DATE ())) projects. = Comment.projectid WHERE comment projectid is empty    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -