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 2130
Try this:
CDate(DateSerial("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.googlegr oups.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 YourDateFieldName from Yourtablename where YourDateFieldName = #" &
Me.Sometextboxintheform & "#"
Linda
"Takeadoe" <mt********@msn.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.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...
|
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....
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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,...
| |