Can you use queries in reports? I'm trying to enter a SQL statement in a text box on a report, but if I do it with an equal sign I get a syntax error. If I do it without an equal sign I get an invalid control source.
If this is possible, where am I going wrong?
Here's my SQL statement: - SELECT CountOfSkillLevel FROM qrySkillsWF WHERE SkillLevelID = 1
Thanks for the help
37 1710 nico5038 3,080
Recognized Expert Specialist
Can you use queries in reports? I'm trying to enter a SQL statement in a text box on a report, but if I do it with an equal sign I get a syntax error. If I do it without an equal sign I get an invalid control source.
If this is possible, where am I going wrong?
Here's my SQL statement: - SELECT CountOfSkillLevel FROM qrySkillsWF WHERE SkillLevelID = 1
Thanks for the help
To get the data out of a table you'll need the DLookup() function like: - =DLookup("CountOfSkillLevel","qrySkillsWF","SkillLevelID = 1")
Nic;o)
NeoPa 32,566
Recognized Expert Moderator MVP
You won't need the query though. You can also use DCount() on the underlying table for similar results (assuming of course that the counting is as simple as it would appear).
I tried the DLookup in the report, but it's not returning a value. It's not even returning an error. I typed it in exactly as shown, checked the names of the tables and columns, and it is coming back blank.
Any ideas what I'm doing wrong? Does it make a difference that it's on a report?
Nevermind...I got it to work. Thanks for the help you guys.
NeoPa 32,566
Recognized Expert Moderator MVP
I'm not clear exactly what you've tried.
How about you post the current SQL of the query the report is built upon, and any relevant controls in the report that are not working as expected.
NeoPa 32,566
Recognized Expert Moderator MVP
Nevermind...I got it to work. Thanks for the help you guys.
Oh, no worries then ;)
I sometimes have to leave a page idle for (quite) a while before I get around to posting a response.
Do you want to let us know what your solution was. In case anyone finds this thread at a later date and wonders how they should duplicate your success.
Ok...I lied. It partially worked, but I know it's probably because of how I have my report setup.
Let me lay it out from the beginning and see if anyone can't figure out where I'm going wrong.
I have a report that is setup like this: -
(Program Header)
-
Program
-
(SkillLevelID Header)
-
SkillLevel SkillLevelID(not visible)
-
(Details)
-
LName FName JobTitle Email PhoneExt
-
(Program Footer)
-
Total Beginner Employees TextBox
-
Total Intermediate Employees TextBox
-
Total Advanced Employees TextBox
-
Total Program Employees TextBox
-
I'm trying to get the total individual skill level for each individual program and have it summarized in the program footer. Then at the end of the report I wanted to put a comprehensive summary.
I created a query to count the data because I couldn't use a count in the program footer to summarize the data in different sections.
When I setup my query I put CountOfSkillLev el and SkillLevel, but that just did totals for the skill level. Then I added program, but my DLookup didn't have anything in it to determine that program was necessary for the lookup.
Here's the SQL for my query: -
SELECT qryWFSummary.Program, Count(qryWFSummary.SkillLevel) AS CountOfSkillLevel, tblSkillLevel.SkillLevel
-
FROM qryWFSummary INNER JOIN tblSkillLevel ON qryWFSummary.SkillLevelID=tblSkillLevel.SkillLevelID
-
GROUP BY qryWFSummary.Program, tblSkillLevel.SkillLevel;
-
Right now my DLookup looks like this: -
=DLookUp("CountOfSkillLevel","qrySkillsWF","SkillLevel = 'Beginner'")
-
Thanks for the help and sorry for thinking I had it figured out.
Can I use an '&' to tell my DLookup that I need to sort the values by the program they describe? Is that possible?
nico5038 3,080
Recognized Expert Specialist
You should be able to count in a report footer without the additional query by using in the textbox:
Nic;o)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Gary |
last post by:
I'm using ASP (VB Script) to generate some reports from a SQL Server
database. These queries often take a significant amount of time to complete,
and many of these reports consist of multiple queries.
One of the biggest problems end users have with this is that if the report
generation is cancelled (e.g. hitting the stop button on the browser) SQL
Server continues to process the request, which usually renders the server
unresponsive...
|
by: Andreas Lauffer |
last post by:
I changed from Access97 to AccessXP and I have immense performance
problems.
Details:
- Access XP MDB with Jet 4.0 ( no ADP-Project )
- Linked Tables to SQL-Server 2000 over ODBC
I used the SQL Profile to watch the T-SQL-Command which Access ( who
creates the commands?) creates and noticed:
|
by: Jonathan LaRosa |
last post by:
Hi all -
I'm wondering if anyone has (or knows of) a tool that will allow me to
search through VB code, tables, queries, reports, forms, and other
objects, for references to all other types of objects.
That's not really that clear, so here's an example:
If I have a table named
"table_i_would_like_to_delete_but_don't_know_if_any_object_is_using_it",
|
by: j.mandala |
last post by:
I have two versions of a database front end and want to be able to use
docmd.copy (or some other method) to move a bunch of queries.
I was able to use the '.tag' property to of forms and reports to move
them using code. For example, first I put the word "Special" in the
..tag property of my reports (or forms), then I use the following
procedure:
Sub CopyReps()
|
by: Jerry Hull |
last post by:
I'm working with a database developed by an untrained person over
several years - and on a network that has recently been upgraded with
a new server installed and MS office upgraded from 2K (I think - it
might have been XP) to 2003. The database is impressive, both in what
it does and the obtuse and inconsistent ways it works. There are
several hundred queries, for example, with no indication of where they
are used or if they are in fact...
| |
by: temp |
last post by:
Hi,
My boss is asking me to generate a column mapping report of all the
queries. Basically, we get our data from ORACLE. There's a queary that
create new table from ORACLE tables. Then, there are reports and
queries that uses the new table.
Is there an add in or tool that can generate mapping reports of the
queries.
|
by: NickName |
last post by:
I understand it's easy to list all saved queries of a given Access
database via Msysobjects system table. However, I have not seen any
posting over this NG or other similar ones that also include SQL
statement(content) of these queries, though I've noticed some VB code
for that. Is that because it's simply impossible to get a query
content (not query resultset) from a SQL stmt?
Thanks in advance.
|
by: Eric |
last post by:
I have an Access 95 database. This database has run for years and now is
giving me a problem. When opened, the switchboard works fine and the
database functions. However, when I close the switchboard and try to open a
table, query or report, the tabs show up for table, query, report and etc.
However, the white box that lists the names of the tables, queries, reports
does not appear. A small rectangle appears in the upper left hand corner of...
|
by: markxxiv |
last post by:
How can I send queries, reports, and perhaps forms for one database via email to a colleague who also has Access 2003 and the same database as the one I'm using to create these queries and reports? I'm using Access 2002, 2003, Windows XP and Yahoo email.
How can I send these queries and reports without sending the entire database each time?
Thank you for your assistance!
Mark / SF Bay Area
|
by: Brett |
last post by:
Hello,
Is it possible to have just one criteria and have it apply to a group
of queries?
I am trying to create a report with the separate results of 4 queries
based on a prompt for the user to input (only once) a date. Is this
something that I program into the report?
Also, this is related but may require a separate posting, but can I do
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |