Hi to all,
I am getting a data type mismatch in the following query in the where
condition:
UPDATE tblBudgetBr SET tblBudgetBr.[To] = DateAdd("yyyy",2,"Date()")
WHERE (((tblBudgetBr.MthToMth)=True));
If I run a normal select with the same criteria,it works fine, can anyone
tell me what is wrong here ??
TIA
|
|
0
|
|
|
|
Reply
|
Utf
|
2/22/2008 8:03:01 PM |
|
On Fri, 22 Feb 2008 12:03:01 -0800, Alain wrote:
> Hi to all,
>
> I am getting a data type mismatch in the following query in the where
> condition:
>
> UPDATE tblBudgetBr SET tblBudgetBr.[To] = DateAdd("yyyy",2,"Date()")
> WHERE (((tblBudgetBr.MthToMth)=True));
>
> If I run a normal select with the same criteria,it works fine, can anyone
> tell me what is wrong here ??
>
> TIA
It shouldn't work fine anywhere.
Are you trying to add 2 years from today's date and store it in [To]?
Remove the quotes from around Date().
UPDATE tblBudgetBr SET tblBudgetBr.[To] = DateAdd("yyyy",2,Date())
WHERE (((tblBudgetBr.MthToMth)=True));
Or are you trying to add 2 years to an existing date already stored
in [To]?
UPDATE tblBudgetBr SET tblBudgetBr.[To] = DateAdd("yyyy",2,[To])
WHERE (((tblBudgetBr.MthToMth)=True));
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
|
|
0
|
|
|
|
Reply
|
fredg
|
2/22/2008 8:25:11 PM
|
|
Alain -
Try removing the quotes around "Date()".
Bob
Alain wrote:
>Hi to all,
>
>I am getting a data type mismatch in the following query in the where
>condition:
>
>UPDATE tblBudgetBr SET tblBudgetBr.[To] = DateAdd("yyyy",2,"Date()")
>WHERE (((tblBudgetBr.MthToMth)=True));
>
>If I run a normal select with the same criteria,it works fine, can anyone
>tell me what is wrong here ??
>
>TIA
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200802/1
|
|
0
|
|
|
|
Reply
|
raskew
|
2/22/2008 8:39:24 PM
|
|
Hi Fred,
I am trying to add 2 year to today's date in the [To] field, I did not
notice the quotes since I did it from the query design to save some typing.
Working fine without the quotes
Thanks
Alain
"fredg" wrote:
> On Fri, 22 Feb 2008 12:03:01 -0800, Alain wrote:
>
> > Hi to all,
> >
> > I am getting a data type mismatch in the following query in the where
> > condition:
> >
> > UPDATE tblBudgetBr SET tblBudgetBr.[To] = DateAdd("yyyy",2,"Date()")
> > WHERE (((tblBudgetBr.MthToMth)=True));
> >
> > If I run a normal select with the same criteria,it works fine, can anyone
> > tell me what is wrong here ??
> >
> > TIA
>
> It shouldn't work fine anywhere.
>
> Are you trying to add 2 years from today's date and store it in [To]?
> Remove the quotes from around Date().
>
> UPDATE tblBudgetBr SET tblBudgetBr.[To] = DateAdd("yyyy",2,Date())
> WHERE (((tblBudgetBr.MthToMth)=True));
>
> Or are you trying to add 2 years to an existing date already stored
> in [To]?
>
> UPDATE tblBudgetBr SET tblBudgetBr.[To] = DateAdd("yyyy",2,[To])
> WHERE (((tblBudgetBr.MthToMth)=True));
>
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail
>
|
|
0
|
|
|
|
Reply
|
Utf
|
2/22/2008 8:44:02 PM
|
|
|
3 Replies
302 Views
(page loaded in 0.469 seconds)
Similiar Articles: Expression with wrong number of arguments?? - microsoft.public ...This is my query qryChartTest CountOfEmployeesName PMonth Total Hours ... It now gives me an "Error 2498: >> > An expression you entered is the wrong data type for ... Access query limitations - microsoft.public.access.formscoding ...There is no way to test for every possible thing that could go wrong in a query. ... using VBA functions that are buggy, missing, or passing the wrong data type (e.g ... Partial match for query criteria - microsoft.public.access ...Hello, I am trying to create a query that will deliver results based on ... Error: Value in Formula of wrong data type - microsoft.public ... Sumproduct for partial ... Query Date Prompt - microsoft.public.access.queriesSometimes it gets it > wrong. In fact it will cause errors with crosstab queries unless you > precisely define the data type of the parameter. This query is typed incorrectly or is too complex to be evaluated ...... can go up to the 99 ANDs and then I get the "query too complex ... buggy, missing, or passing the wrong data type (e ... data types) > - pass-through queries that are ... link append query to combobox - microsoft.public.access.queries ...... first, cboMRSearchChart looks up a specific ID number (text datatype ... in the design grid of the ... I am obviously doing something wrong when setting up the append query?? Format DatePart - microsoft.public.access.queries... month name (not just the number) from a ChkDate field in a query. ChkDate is a Date/Time data type. ... Here's what I'm trying, and I can't see what's wrong according to ... count query and negative numbers question - microsoft.public ...Hi All, Pretty new to database queries ... and users are recording in the wrong catagories. I'll get more data and post again SELECT DISTINCTROW Data.Location, Data.Type ... Database Queries with database views, that base on many database t ...When I use the database views in a query like this ... He defines/chooses the data type of such an attribute. ... > > > My question: Is it a wrong message? Is there a ... entering parameter criteria MS Query - microsoft.public.excel.misc ...If I use a field with an NVARCHAR data type (which is the one I want) I ... criteria in SQL Server Management Studio 2005, but not in MS Query. What am I doing wrong?! MySQL Bugs: #19714: COALESCE() returns wrong datatype in VIEWsCOALESCE() returns wrong datatype in VIEWs: Submitted: 11 May 2006 9:13: Modified: ... How to repeat: localhost-test [bvontob]> CREATE TABLE t (i INT, j INT); Query OK ... Excel ODBC Driver May Determine Wrong Data Type - Microsoft SupportWhen you use a Microsoft Excel worksheet as a data source in Microsoft Query, and you attempt to create a join between two fields of seemingly similar data ... Query and View Designer Considerations for SQL Server DatabasesIf you are creating queries using Microsoft® SQL ... higher, you can include references to the GUID data type ... results might appear in the Results pane with incorrect ... query() Method (xml Data Type)Specifies an XQuery against an instance of the xml data type. The result is ... section provides examples of using the query() method of the xml data type. A. Using the query ... Update Query ? Incorrect use of the xml data type method 'modify ...Update Query ? Incorrect use of the xml data type method 'modify'. A non-mutator method is expecte. I have a column of ntext da ta type and NOT XML. It stores all ... 7/18/2012 7:38:52 AM
|