[AccessD] Ambiguous Nmae in Query Expression

Jim Dettman jimdettman at earthlink.net
Thu Apr 13 10:48:38 CDT 2006


 Change to 

 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

  and BTW, it's a bad idea to use a reserved word as the name of a field
('Date').  Never know when something like that will give you a problem.
That may be the problem here.

Jim.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester
Sent: Thursday, April 13, 2006 8:41 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Ambiguous Nmae in Query Expression

I have a function in a module as follows:

Function DaysInMonth2(D As Variant) As Variant

 

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

FROM ProdPattern INNER JOIN [qry Pattern Days on Injection by Fluid] ON
(ProdPattern.PID = [qry Pattern Days on Injection by Fluid].PID) AND
(ProdPattern.Date = [qry Pattern Days on Injection by Fluid].Date)

WHERE (((ProdPattern.PID)=[Pattern Name]));

 

Chester Kaup

Engineering Technician

Kinder Morgan CO2 Company, LLP

Office (432) 688-3797

FAX (432) 688-3799

 

 

No trees were killed in the sending of this message. However a large
number of electrons were terribly inconvenienced.

 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list