D
David
I have a query that returns some data
SELECT l.link_name, l.type, l.web_link, l.newsletter_id, count(s.ipaddress) AS hit
FROM newsletter_links AS l, stats AS
WHERE l.newsletter_links_id=s.news_link_i
GROUP BY l.link_name, l.type, l.web_link, l.newsletter_id
I need one more colum of data that is the same as the column [hits] but it needs to be a distinct count. Since access won't do a count(distinct) I'm out of ideas on how to do this. Here is how I would do that count by itself in Access
Select count(*) from (SELECT DISTINCT (s.ipaddress) AS exp
FROM newsletter_links AS l, stats AS
WHERE l.newsletter_links_id=s.news_link_i
GROUP BY l.link_name, l.type, l.web_link, l.newsletter_id, s.ipaddress)
Can anyone help me get this into one query
SELECT l.link_name, l.type, l.web_link, l.newsletter_id, count(s.ipaddress) AS hit
FROM newsletter_links AS l, stats AS
WHERE l.newsletter_links_id=s.news_link_i
GROUP BY l.link_name, l.type, l.web_link, l.newsletter_id
I need one more colum of data that is the same as the column [hits] but it needs to be a distinct count. Since access won't do a count(distinct) I'm out of ideas on how to do this. Here is how I would do that count by itself in Access
Select count(*) from (SELECT DISTINCT (s.ipaddress) AS exp
FROM newsletter_links AS l, stats AS
WHERE l.newsletter_links_id=s.news_link_i
GROUP BY l.link_name, l.type, l.web_link, l.newsletter_id, s.ipaddress)
Can anyone help me get this into one query