Here's the SQL. Since the holiday array was not working, I have not
included
it as part of the workday functions.
SELECT [T Lot Data].[Lot ID], [T Lot Data].[Release Number], [T Lot
Data].[Lot Number], [T Const Schedules].ConstSchedule, [T Const Planned
Start
Dates].[Start Date], dhAddWorkDaysA([T Const
Schedules]![StakeTrench],[Start
Date]) AS ST, dhAddWorkDaysA([T Const Schedules]!PourFootings,[ST]) AS PF,
dhAddWorkDaysA([T Const Schedules]!PourSlab,[PF]) AS PS, dhAddWorkDaysA([T
Const Schedules]![Frame Start],[PS]) AS FS, dhAddWorkDaysA([T Const
Schedules]!FrameComplete,[FS]) AS FC, dhAddWorkDaysA([T Const
Schedules]!ExteriorDryin,[FC]) AS ED, dhAddWorkDaysA([T Const
Schedules]!FrameInspection,[ED]) AS FI, dhAddWorkDaysA([T Const
Schedules]!PreDrywallOrientation,[FI]) AS PDO, dhAddWorkDaysA([T Const
Schedules]!TextureComplete,[PDO]) AS TC, dhAddWorkDaysA([T Const
Schedules]!CabinetsComplete,[TC]) AS CC1, dhAddWorkDaysA([T Const
Schedules]!CarpetComplete,[CC1]) AS CC2, dhAddWorkDaysA([T Const
Schedules]!FinalInspection,[CC2]) AS FI2, dhAddWorkDaysA([T Const
Schedules]!QualityAssurance,[FI2]) AS QuAs, dhAddWorkDaysA([T Const
Schedules]!HomeownerOrientation,[QuAs]) AS HOO, dhAddWorkDaysA([T Const
Schedules]!ReviewandAcceptance,[HOO]) AS RvAc, dhAddWorkDaysA([T Const
Schedules]!ConstCOE,[RvAc]) AS CCOE
FROM [T Const Schedules], [T Const Planned Start Dates] INNER JOIN [T Lot
Data] ON [T Const Planned Start Dates].[Lot ID] = [T Lot Data].[Lot ID]
ORDER BY [T Const Planned Start Dates].[Start Date];
--
Keep the pedal down!
Douglas J. Steele said:
How are you using the function in your query? Post your SQL. (If you're
not
familiar with SQL, open the query in Design view, then select View | SQL
View from the menu)
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
I changed the declaration and still get the same error message. Any
other
suggestions?
--
Keep the pedal down!
:
Are any of the StartDate values Null? dhAddWorkDaysA will only accept
valid
dates, not Nulls.
You could use Nz to change the nulls fo some valid date value, or you
could
try changing the declaration to
Public Function dhAddWorkDaysA(lngDays As Long, _
Optional dtmDate As Variant = 0, _
Optional adtmDates As Variant) As Date
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
In a query when I use the following expression
dhAddWorkDaysA(12,[StartDate],Array(#5/28/2007#,#7/4/2007#,#9/3/2007#))
I get an error message "Data Type mismatch in criteria expression"
What am I doing wrong?