A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem of dateAdd() function



 
 
Thread Tools Display Modes
  #1  
Old July 11th, 2008, 08:24 PM posted to microsoft.public.access.queries
Luting
external usenet poster
 
Posts: 6
Default Problem of dateAdd() function

Hi all,

I have an error when using the function dateAdd(). Here is my sql
statement:
SELECT FLINK_N_OPERLOG.*
FROM YQPW, FLINK_N_OPERLOG
WHERE (((FLINK_N_OPERLOG.TMSTAMP)=" [Forms]![YQPW]![BEGIN]" And
(FLINK_N_OPERLOG.TMSTAMP)=DateAdd("n","20",[Forms]![YQPW]![BEGIN])));

The error says:
This expression is typed incorrectly, or it is too complex to be
evaluated.

How can I fix it?
Is DateAdd("n", "20", sth.)=sth.+20(min)?

Thanks in advance.
  #2  
Old July 11th, 2008, 08:35 PM posted to microsoft.public.access.queries
Amy Blankenship
external usenet poster
 
Posts: 539
Default Problem of dateAdd() function


"Luting" wrote in message
...
Hi all,

I have an error when using the function dateAdd(). Here is my sql
statement:
SELECT FLINK_N_OPERLOG.*
FROM YQPW, FLINK_N_OPERLOG
WHERE (((FLINK_N_OPERLOG.TMSTAMP)=" [Forms]![YQPW]![BEGIN]" And
(FLINK_N_OPERLOG.TMSTAMP)=DateAdd("n","20",[Forms]![YQPW]![BEGIN])));

The error says:
This expression is typed incorrectly, or it is too complex to be
evaluated.

How can I fix it?
Is DateAdd("n", "20", sth.)=sth.+20(min)?


Is it possible that the problem is actually with FLINK_N_OPERLOG.TMSTAMP)="
[Forms]![YQPW]![BEGIN]", which seems to be comparing a date field with a
string value (note the quotes)?


  #3  
Old July 11th, 2008, 10:10 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Problem of dateAdd() function

Remove some quotes as you want to add 20, a number and not text characters.

Try this, changing your text entry to date --
SELECT FLINK_N_OPERLOG.*
FROM YQPW, FLINK_N_OPERLOG
WHERE [FLINK_N_OPERLOG].[TMSTAMP]= CVDate([Forms]![YQPW]![BEGIN]) And
[FLINK_N_OPERLOG].[TMSTAMP]=DateAdd("n",20,CVDate([Forms]![YQPW]![BEGIN]));

--
KARL DEWEY
Build a little - Test a little


"Luting" wrote:

Hi all,

I have an error when using the function dateAdd(). Here is my sql
statement:
SELECT FLINK_N_OPERLOG.*
FROM YQPW, FLINK_N_OPERLOG
WHERE (((FLINK_N_OPERLOG.TMSTAMP)=" [Forms]![YQPW]![BEGIN]" And
(FLINK_N_OPERLOG.TMSTAMP)=DateAdd("n","20",[Forms]![YQPW]![BEGIN])));

The error says:
This expression is typed incorrectly, or it is too complex to be
evaluated.

How can I fix it?
Is DateAdd("n", "20", sth.)=sth.+20(min)?

Thanks in advance.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.