Expression changes data type

COS_T

New member
Local time
Today, 16:34
Joined
Aug 13, 2010
Messages
5
New to forum but I've been reading, reviewing, and learning from this forum for a while...

My question:
I have a query the includes an expression that produces an HR deadline date based on an employee's hiring paperwork's start date and the HR pay-period's beginning and end date. I've written the formula correctly (I get the expected results), but the output is converted to a text field as opposed to a date field.

Here is SQL of the query and some additional information - the expression is colored blue.

SELECT tblePAF_HISTORY_APPROVAL.ePAF_Num, Min(IIf([Effective_Date]>=[tblHRDeadlines].[PP_Begin],IIf([Effective_Date]<=[tblHRDeadlines].[PP_End],[tblHRDeadlines].[Due_to_HR],"unknown"))) AS HRDeadline, tblePAF_HISTORY_APPROVAL.Effective_Date

FROM tblePAF_HISTORY_APPROVAL, tblHRDeadlines

GROUP BY tblePAF_HISTORY_APPROVAL.ePAF_Num, tblePAF_HISTORY_APPROVAL.Effective_Date;


Each of the above-referenced fields is a date data-types.

Why is the output for "HRDeadline" text, and how do I make it a date data-type?
 
The output is changed to text because you have set the false to be "unknown" which can't be used in a date field.
 
Because you have an "Unknown" option in your SQL this deems it to be a text field.
 
So simple.... sometimes it's just too late in the day to be writing formulas.
Thank you.
 

Users who are viewing this thread

Back
Top Bottom