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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |
Taher | Setting Up & Running Reports | 1 | August 31st, 2004 09:07 PM |