The immediate If (IIf) function has three parts the expression to evaluate, action if the expression is true, and the action if the expression is false. Your complete expression should look similar to the following:
End Date: IIf([Earnings End Dt]=#1/1/1900#,DateAdd("d", 365, Now()),DateAdd("d", 365, [Earnings End Dt]))
Darrell
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Jim Wagner
Sent: Monday, February 03, 2014 2:07 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Manipulate date in query
Duane
I had changed the expression to the following but it leaves out the dates that are not 1/1/1900. The values with good dates are empty. There was a business process that forced them to put the 1/1/1900. I guess it is a flag of some kind.
I guess I am not sure how to explain it.
End Date: IIf([Earnings End Dt]=#1/1/1900#,DateAdd("d",Now()+365,[Earnings End Dt]))
Jim Wagner
On Monday, February 3, 2014 12:02 PM, Duane Hookom <duanehookom@hotmail.com> wrote:
Jim,
The system date is returned from the Date() function although I'm not sure that is what you mean.
Duane Hookom MVP
MS Access
________________________________
> From: luvmymelody@yahoo.com
>
>
> I have a query that we need to show a value of the value of the date + 365
> The value that we are having trouble with is that the field has the
> value of 1/1/1900. I have the below expression but I don not know how
> to put the system date in the IIf statement. Can anyone help with this?
>
> End Date: IIf([Earnings End Dt]=#1/1/1900#,DateAdd("d",365,[Earnings
> End Dt]))
>
> Thank You
>
>
> Jim Wagner
The information contained in this communication is highly confidential and is intended solely for the use of the individual(s) to whom this communication is directed. If you are not the intended recipient, you are hereby notified that any viewing, copying, disclosure or distribution of this information is prohibited. Please notify the sender, by electronic mail or telephone, of any unintended receipt and delete the original message without making any copies.
Blue Cross Blue Shield of Michigan and Blue Care Network of Michigan are nonprofit corporations and independent licensees of the Blue Cross and Blue Shield Association.
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar