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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|