Stuart McLachlan
stuart at lexacorp.com.pg
Thu Apr 13 09:28:20 CDT 2006
On 13 Apr 2006 at 8:41, Kaup, Chester wrote: > I have a function in a module as follows: > > Function DaysInMonth2(D As Variant) As Variant First point - avoid variants wherever possible. Try defining D and the function as dates. > When I try to use the function in a query I get the message Ambiguous > Name in Query Expression (DaysInMonth2([ProdPattern]![Date]) AS Expr1) > > This is the first time I have tried to use a user defined function in a > query. I need some help on how to do this. Thanks > > > > The SQL is a follows: > > SELECT ProdPattern.PID, ProdPattern.Date, ProdPattern.vm_wtri, > ProdPattern.vm_co2i, [qry Pattern Days on Injection by > Fluid].vm_dyswtri, [qry Pattern Days on Injection by Fluid].vm_dysco2i, > DaysInMonth2([ProdPattern]![Date]) AS Expr1 > Try a dot instead of a bang in [ProdPattern]![Date] -- Stuart