I cannot seem to refer to a derived field in criteria. Better phrased: I cannot refer to a derived field in the where clause of the query. The following does not use the value from the derived field and causes access to pop a message box to fill the value for endDate. I have tried the name of the query [q_ProjectSearch].endDate and this also fails. I have tried quotes "endDate" and this also fails. I have also tried: [q_ProjectSearch]![endDate], [endDate], endDate. I am running the query only and not using the form it is intended for to remove those elements.
Thank you for any assistance
SELECT [t_CTP Project Data].BaseProjectNum ber, t_Projects.Proj ect_Number, [t_CTP Project Data].ProjectName, [t_CTP Project Data].DurationDays, t_ProjectArea.I D_WorkType, [t_CTP Project Data].NtpDate, t_ProjectArea.I D_Facility, t_ProjectArea.I D_DatePart, t_Projects.ID_P rojects, [NtpDate]+[DurationDays] AS endDate FROM ([t_CTP Project Data] RIGHT JOIN t_Projects ON [t_CTP Project Data].BaseProjectNum ber = t_Projects.PIN) INNER JOIN t_ProjectArea ON t_Projects.ID_P rojects = t_ProjectArea.I D_Project where [Forms]![f_projectSearch]![tbFilterEndDate] <= [t_CTP Project Data].NTPdate and [Forms]![f_projectSearch]![tbFilterStartDa te] >= endDate;
2 1806
I cannot seem to refer to a derived field in criteria. Better phrased: I cannot refer to a derived field in the where clause of the query. The following does not use the value from the derived field and causes access to pop a message box to fill the value for endDate. I have tried the name of the query [q_ProjectSearch].endDate and this also fails. I have tried quotes "endDate" and this also fails. I have also tried: [q_ProjectSearch]![endDate], [endDate], endDate. I am running the query only and not using the form it is intended for to remove those elements.
Thank you for any assistance
SELECT [t_CTP Project Data].BaseProjectNum ber, t_Projects.Proj ect_Number, [t_CTP Project Data].ProjectName, [t_CTP Project Data].DurationDays, t_ProjectArea.I D_WorkType, [t_CTP Project Data].NtpDate, t_ProjectArea.I D_Facility, t_ProjectArea.I D_DatePart, t_Projects.ID_P rojects, [NtpDate]+[DurationDays] AS endDate FROM ([t_CTP Project Data] RIGHT JOIN t_Projects ON [t_CTP Project Data].BaseProjectNum ber = t_Projects.PIN) INNER JOIN t_ProjectArea ON t_Projects.ID_P rojects = t_ProjectArea.I D_Project where [Forms]![f_projectSearch]![tbFilterEndDate] <= [t_CTP Project Data].NTPdate and [Forms]![f_projectSearch]![tbFilterStartDa te] >= endDate;
I believe you cannot use a column alias in a where clause, only in an Order By clause; so change this:
[Forms]![f_projectSearch]![tbFilterStartDa te] >= endDate;
TO:
[Forms]![f_projectSearch]![tbFilterStartDa te] >= [NtpDate]+[DurationDays];
DOH! Thanks for the assistance!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Bob Sanderson |
last post by:
I am using the following query to calculate a date for a report ...
Cal Due: DateAdd("m",!,!
)
I now need to select all records whose Cal Due date is less than the date
of the report. I have tried to use Date() as the critera but I get a "Data
Type Mismatch" error. If I input "10/*/03" as the criteria I can pull up
all of the records for October but I can't figure out how to select records
before a specific date.
|
by: Norma |
last post by:
I am trying to capture data in a date parameter query that spans from
1 to 3 months. I have a field that is a checkbox that notes whether or
not this data is 'red flagged' (so you know, the red flagged data is
end of the month production that is reported in the following months
report)
I need to capture the red flagged production from the previous month
and the production from the entered month(s) not including the red
flagged production...
|
by: John young |
last post by:
I have been looking for an answer to a problem and have found this
group and hope you can assist .
I have been re doing a data base I have made for a car club I am with
and have been trying to make a query that selects from a table as
desribed below ..
I have a table (Volunteer) that has a member field (memnumber)
and a number of fields that are headed in various categories and are
yes/no formated
|
by: S. van Beek |
last post by:
Dear reader,
How can I filter a numeric field with Like as criteria in a query.
To filter a numeric field with <10 as criteria this will com back with the
result of those records for which the value is smaller as teen.
But in case this value is variable and you prefer to work with "Like
|
by: MLH |
last post by:
I have an A97 query (qryVehiclesNowners2) that has a table
field in it named . Depending on the selections made
in a number of criteria choices on a form, a field on the form
will have string values in it like...
Between #12/1/2004# And #12/31/2004# - or -
>= #6/10/2005# - or -
Between #6/1/2005# And #6/30/2005#
I want to use them as criteria for the query.
| |
by: David - Australia |
last post by:
G'day from Australia,
I'm hoping some bright spark may be able to help me with this one. I'm
sure that it can be done, I've just hit a wall with it. So I'm opening
it up.
I'm storing student competencies for a given number of performance
criteria (which are stored in a separate reference table).
Students are rated competent or not (yes/no field) on up to 5
assessments - Task, Observation, Project, Practical Test, Exam for
|
by: bullockbefriending bard |
last post by:
i have a large collection of python objects, each of which contains an
integer 6-tuple as part of its data payload. what i need to be able to
do is select only those objects which meet a simple tuple element
wildcard matching criterion. e.g. given the following python objects:
object A includes tuple (1,2,3,4,5,6)
object B includes tuple (1,4,4,4,11,1)
object C includes tuple (1,3,9,1,1,1)
all tuples are unique. for what it's worth,...
|
by: Bob Johnson |
last post by:
I have a base class that must have a member variable populated by, and only
by, derived classes.
It appears that if I declare the variable as "internal protected" then the
base class *can* populate the variable, but the population is not *required*
by the derived class (which must be the case).
What would meet the requirements is if I create an abstract method in the
base class that populates the member variable. In this case the...
|
by: AccessHunter |
last post by:
Hi,
I have a column in my query that derives Age like this,
Age: DateDiff("yyyy",,).
I tried giving a value '18' as the criteria and its not letting me do it. Without the criteria everything works fine.
I am sure someone might have come across similar situation, please help me with your findings.
Thanks
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |