Can't execute a user define function in an SQL statement 
Author Message
 Can't execute a user define function in an SQL statement

Quote:

>  SELECT CM.CM_no,
>   module_description,
>    CM.Date,
>    Datediff("y",[date],Now()) AS Days_Elap,
>    CM.Details,
>    mid ([cm].[cm_no],5,2) AS Year,
>    left([cm].[cm_no],3) AS Header,
>    calculate_age([date]) as Days_Elaps

>  FROM (Completed RIGHT JOIN CM ON Completed.CM_no = CM.CM_no)
>    LEFT JOIN Module ON left([CM].[CM_no],3) = module.Module

>  WHERE (((Completed.CM_no) Is Null));

Well, there's clearly problems with subnormalised data, and the use of
reserved words does make things more difficult to analyse.

Can we assume that you are calling this all within Access, not from VB
or delphi etc?

How is calculate_age defined: again, can we assume this is a Public
Function in a normal module? Is module_description a function or a
field name?

What exactly is the error message:

Quote:
>the computer replied, function not found or something like that

could be a little more explicit!

Tim F

--



Mon, 13 Aug 2001 03:00:00 GMT  
 Can't execute a user define function in an SQL statement

Quote:

>sub test()
>testdte = #1/1/99#
>calculate_age(testdte)

If this runs then that's your problem: if calculate_age() is defined
as Public Sub then Access won't run it as a Function. Can you post the
definition of this procedure (not the whole code)?

HTH

Tim F

--



Tue, 14 Aug 2001 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. How to execute 2 SQL statements in the user-defined query

2. User-defined functions inside SQL statement??

3. User Defined Functions in SQL Statements

4. User defined functions in a SQL statement

5. Include a user defined function in an SQL statement

6. SQL Statement with an User defined function

7. executing Access query containing a user-defined function through VB

8. Executing Access query containing a user-defined function through VB

9. User-defined error when the user doesn't define any errors

10. User-defined functions suddenly aren't recognized

11. SQL and user-defined functions

12. User defined SQL functions

 

 
Powered by phpBB® Forum Software