A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

use unrelated query in report footer



 
 
Thread Tools Display Modes
  #1  
Old November 30th, 2004, 06:08 PM
Art Marks
external usenet poster
 
Posts: n/a
Default use unrelated query in report footer

I have a report based on a single table with groups on a date field by month
and year. In the date by year footer I want to include a text box with a
value given by a query (a TOP 1 query that returns a single value). I can't
figure out a syntax using either the query name or the SQL behind the query
that will work. When I try something like = [Queryname].[fieldname] it
thinks this is a parameter. Let me know if you need more information.

Thanks for any help,

--Art


  #2  
Old November 30th, 2004, 07:11 PM
Marshall Barton
external usenet poster
 
Posts: n/a
Default

Art Marks wrote:
I have a report based on a single table with groups on a date field by month
and year. In the date by year footer I want to include a text box with a
value given by a query (a TOP 1 query that returns a single value). I can't
figure out a syntax using either the query name or the SQL behind the query
that will work. When I try something like = [Queryname].[fieldname] it
thinks this is a parameter. Let me know if you need more information.



You can't refer to a query directly in an expression, but
you can use a function that retrieves a value from the
query. Since you only want a single value, the built-in
DLookup function will take care of it. Just use an
expression in the report's text box:

=DLookup("nameoffield", "nameofquer")

--
Marsh
MVP [MS Access]
  #3  
Old December 1st, 2004, 07:54 AM
Art Marks
external usenet poster
 
Posts: n/a
Default

Worked great. Thanks.

--Art



"Marshall Barton" wrote in message
...
Art Marks wrote:
I have a report based on a single table with groups on a date field by
month
and year. In the date by year footer I want to include a text box with a
value given by a query (a TOP 1 query that returns a single value). I
can't
figure out a syntax using either the query name or the SQL behind the
query
that will work. When I try something like = [Queryname].[fieldname] it
thinks this is a parameter. Let me know if you need more information.



You can't refer to a query directly in an expression, but
you can use a function that retrieves a value from the
query. Since you only want a single value, the built-in
DLookup function will take care of it. Just use an
expression in the report's text box:

=DLookup("nameoffield", "nameofquer")

--
Marsh
MVP [MS Access]



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Still Hoping for help with a Query problem Don Sealer Using Forms 15 November 13th, 2004 06:24 AM
Return repeats info in "8s" Joy Rose Running & Setting Up Queries 14 October 13th, 2004 10:07 PM
Report footer conflicting with query ctdak Setting Up & Running Reports 3 September 18th, 2004 09:33 PM
Print Taher Setting Up & Running Reports 1 August 31st, 2004 09:07 PM


All times are GMT +1. The time now is 09:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.