Rabu, 02 November 2011

RE: [MS_AccessPros] UNION query "Too Complex"

Replace a pair of " with [] so you reference the field [FolderName] rather than the string "Foldername":

SELECT qStatsYTD.Page, qStatsYTD.Visitors
FROM qStatsYTD, tblWebFolders
WHERE (((qStatsYTD.Page) Like "*" & [Foldername] & "*"));

I would then change this to a totals query:

SELECT [FolderName], Sum(qStatsYTD.Visitors) As TotalVisitors
FROM qStatsYTD, tblWebFolders
WHERE (((qStatsYTD.Page) Like "*" & [Foldername] & "*"))
GROUP BY [FolderName];


Duane Hookom
MS Access MVP

To: MS_Access_Professionals@yahoogroups.com
From: robinski@mymail.net.au
Date: Wed, 2 Nov 2011 11:37:49 +1100
Subject: RE: [MS_AccessPros] UNION query "Too Complex"



Duane,

Many thanks for the step by step instructions. They were needed. I
have achieved the first step!

At 1/11/2011 09:44 AM, you wrote:

>I would create a table with fields like:
>
>tblWebFolders
>==================
>FolderName text for values like au/clubs/atoc/albury...
>FolderTitle text for values like "Albury"

tblWebFolders
FolderName FolderTitle
au/clubs/atoc/Albury/ Albury
au/clubs/atoc/Albury Hume/ Albury Hume
au/clubs/atoc/Albury North/ Albury North
au/clubs/atoc/Albury West/ Albury West
au/clubs/atoc/Alexandra/ Alexandra
au/clubs/atoc/Appin Park Wangaratta/ Appin Park Wangaratta
au/clubs/atoc/Beechworth/ Beechworth
au/clubs/atoc/Bellbridge Lake Hume/ Bellbridge Lake Hume
au/clubs/atoc/Belvoir Wodonga/ Belvoir Wodonga
au/clubs/atoc/Benalla/ Benalla
au/clubs/atoc/Bright/ Bright

>Then create a query with qStatsYTD and tblWebFolders. Set the
>criteria under Page to:
> Like "*" & Foldername & "*"

At this stage I failed.

SELECT qStatsYTD.Page, qStatsYTD.Visitors
FROM qStatsYTD, tblWebFolders
WHERE (((qStatsYTD.Page) Like "*" & "Foldername" & "*"));

produces no records.

What have I missed?

Regards,.

Robin Chapple


[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)

<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Tidak ada komentar:

Posting Komentar