By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,806 Members | 1,490 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,806 IT Pros & Developers. It's quick & easy.

A2K3: Use control on form for calculated field

P: n/a
I need to create a calculated field in a query that will subtract two
dates: HireDate and EndDate. The problem I'm having is that while
HireDate is field in one of my tables, EndDate is coming from a control
on a popup form. I've tried using [forms]![MyForm]![EndDate] -
[HireDate] in various forms, and I've also tried creating another field
in my query, setting it to EndDate's value, and then subtracting.
Neither of these are correct apparently as all I get is #error. Any
ideas would be greatly appreciated.


Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a

Did you use the date Diff formula? or placing th the query's criteria
"Between ([HireDate) And (forms![EndDate]])

Nov 13 '05 #2

P: n/a

Thanks for the reply. I didn't try the DateDiff function, but I will.

I need to actually calculate a value, not limit values I already have,
so I don't think doing anything with criteria will work. Here's the
SQL of the query I'm trying to run; it may be helpful to see exactly
what I'm after.

SELECT tbl_employee_info.EmployeeID, tbl_employee_info.HireDate,
([forms]![frm_turnover_rpt_dates]![txtSecondDate])-[HireDate] AS
FROM tbl_employee_info;

Any further suggestions?


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.