I recently asked the group for help on converting 3 numeric variables
to a new date variable. The DATESERIAL function below worked
perfectly! My question now relates to problems with this new variable
when I try to filter either by form or selection.
If I type 10/20/2005, just as you see it, with no quotes or other
punctuation, in the testHarvestDate field I get the following error
message: DATATYPE MISMATCH IN CRITERIA EXPRESSION and Access then locks
up on me!
What is the problem here? Any help would really be appreciated.
Regards,
Mike
testHarvestDate :
DateSerial((IIf ([harvest_month]=1,2006,2005)),[harvest_month],[day]) 4 2151
Try this:
CDate(DateSeria l("yyyy", "mm", "dd)) where the date in the dateserial is
your important date. It sounds like it is treating DateSerial as a text
value.
Linda
"Takeadoe" <mt********@msn .com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. . I recently asked the group for help on converting 3 numeric variables to a new date variable. The DATESERIAL function below worked perfectly! My question now relates to problems with this new variable when I try to filter either by form or selection.
If I type 10/20/2005, just as you see it, with no quotes or other punctuation, in the testHarvestDate field I get the following error message: DATATYPE MISMATCH IN CRITERIA EXPRESSION and Access then locks up on me!
What is the problem here? Any help would really be appreciated.
Regards,
Mike
testHarvestDate : DateSerial((IIf ([harvest_month]=1,2006,2005)),[harvest_month],[day])
Linda,
Thank you for the reply. I tacked cdate on the front as suggested and
got the same error message. Any other suggestions?
Regards,
Mike
Okay, just thought of what that could be. In the query or SQL statement try
adding a # before where the date goes and right after it. Example:
Select YourDateFieldNa me from Yourtablename where YourDateFieldNa me = #" &
Me.Sometextboxi ntheform & "#"
Linda
"Takeadoe" <mt********@msn .com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. . Linda,
Thank you for the reply. I tacked cdate on the front as suggested and got the same error message. Any other suggestions?
Regards,
Mike
Linda - This is the code that creates the new date variable called
testharvestdate .
testHarvestDate :
DateSerial((IIf ([harvest_month]=1,2006,2005)),[harvest_month],[day])
I'm not sure where you want me to add the # - in the above or during
the actual filter? Okay, I guess my inexperience with Access is
shining through - loud and clear. I've been a SAS programmer for 15
years and using Access for a few weeks!
Your help and patience are much appreciated.
Mike This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: CSDunn |
last post by:
Hello,
I have a problem with field filtering between an Access 2000 Project form
(the application is called CELDT), and the report that shows the results of
the filter. Both the form and the report are based on the same View
addressed in the Record Source of both as 'dbo.CLMain_vw'. The View resides
in a SQL Server 2000 database. There are two different problems I am having
with filtering: The first involves filtering in the form by date...
|
by: damjanu |
last post by:
Hi All;
I need little help.
I have a datasheet form.
I allow user to do 'filter by selection'.
My form contains a column with values.
As user changes selections, I want to
calculate totals. I can do this the
first time the form loads.
|
by: Terry |
last post by:
I have cerated a Form, ExamsFrm, which is used to input details of
exams taken at several Centres. It dosplays details from StudentTbl
and has a SubForm which displays details from ExamsTble.
I have incorporated some VB6 code as well as some Conditional
Formatting. The code automatically updates CheckBoxes in the SubForm,
depending on exam results, and the Conditional Formatting changes
background colours, depending on CheckBox datum.
...
|
by: Ralph2 |
last post by:
Some time ago with a lot of help from this group I made a reasonably
successful database to keep track of our shop drawings. However the
searching mechanism is too complicated for the occasional user and I
would like to change the whole process.
I would like to duplicate the layout of my form... but each field
becomes a simple "searching" ListBox. On completing any one search
field all the rest are filtered to this value. Subsequent...
|
by: lorirobn |
last post by:
Hi,
I have a report that works just fine.
Now I would like to add the capability to choose selection criteria to
limit what is displayed. I created several reports that do this, but
they used VBA to create SQL statements, then apply them. Now that I
have been using Access/VBA for awhile, I am wondering if there is a
simpler way to do this than coding these long sql statements.
My report has a query as its record source. Can I just...
| |
by: vunderusaf |
last post by:
I have a listbox on a form that is selecting using named FinalQuery:
SELECT ., .,
.
FROM FinalQuery;
Now I have a text field with a date on this form and I'd like to use
that date as the selection criteria, comparing to the ...
how would I use a field with the WHERE clause?
|
by: jcf378 |
last post by:
hi all.
I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ).
However, when I click "Filter by Form" in order to search for records based on this form, I would like to be able to enter a value in this "days" control so that I can filter records on the form based on this calculated interval (i.e., i want to search for records specifically where...
|
by: DAHMB |
last post by:
Hi all,
Using Access 2007
I have a report called Sunday School Attendance based on a Query called qryAttendance the query is as follows:
SELECT tblSundaySchoolAttendance.StudentID, tblSundaySchoolAttendance.AttendanceDate, .
FROM tblSundaySchoolAttendance INNER JOIN ON tblSundaySchoolAttendance.StudentID=.StudentID;
|
by: Rich P |
last post by:
Maybe you could try using a query as the recordsource for your subforms
and for the criteria field in the query you could use a Form parameter.
This way - instead of using the form filter property you could set a
value in a textbox on your mainform which would filter the query. This
way all of your subforms are synchronized.
fieldname: fldx
Criteria: Like Forms!Form1!Text0
Text0 would be a textbox on your main form (Form1 or...
|
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: 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: 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: 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: 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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |