From: John W. Vinson on
On Tue, 23 Mar 2010 23:12:10 GMT, "JOSELUIS via AccessMonster.com"
<u58123(a)uwe> wrote:

>OK I refuse to go on I change colon by semicolons, english into spanish NZ to
>Nz or NzDate() and nothing ever happens so I�ve decided to stop working on
>this I need a holidays maybe I�ll go to St James�way and I hope to get
>enough strength to go on with this.
>Up to then God Bless you.

Buen suerte y ten un buen dia. Ojala que San Tiago tendra merced...
--

John W. Vinson [MVP]
From: Al Campagna on
JOSELUIS,
Cut & Paste exactly what you have in your calculation at this time.
We always need to see your code if you still have a problem.
Both John's and my suggestion should work, but John's is a more elegant
solution... in that it substitutes Date() for DateOut, if DateOut is null.
Why don't we stick with John's code for now...
--
hth
Al Campagna
Microsoft Access MVP 2007-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


"JOSELUIS via AccessMonster.com" <u58123(a)uwe> wrote in message
news:a57587981698c(a)uwe...
> OK I refuse to go on I change colon by semicolons, english into spanish NZ
> to
> Nz or NzDate() and nothing ever happens so I�ve decided to stop working on
> this I need a holidays maybe I�ll go to St James�way and I hope to get
> enough strength to go on with this.
> Up to then God Bless you.
>
> John W. Vinson wrote:
>>>Oh my God! I�ve tried everything but it doesn�t work.Firstly I put IIF in
>>>the
>>>calculated control TotalDays but it didn�t calculate the total number of
>>[quoted text clipped - 12 lines]
>>>End If
>>>End Function
>>
>>I'm not sure why you're having all the problems, but if there are
>>textboxes
>>named DateIn and DateOut (not DatOut!!!) on your form, you should be able
>>to
>>just use a control source of
>>
>>=DateDiff("d", [DateIn], NZ([DateOut], Date())
>>
>>This assumes that DateIn will always have a date; if it might be null,
>>
>>=IIF(IsNull([DateIn], Null, DateDiff("d", [DateIn], NZ([DateOut], Date()))
>>
>>Note Date() - the function - rather than [Date], which would refer to a
>>field
>>or control.
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1
>


From: Douglas J. Steele on
Time to get your prescription checked, John? <g>

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"John W. Vinson" <jvinson(a)STOP_SPAM.WysardOfInfo.com> wrote in message
news:nk7iq59db41nsrfa43rdnca48309agp0tj(a)4ax.com...
>
> =DateDiff("d", [DateIn], NZ([DateOut], Date())

You need an extra closing parenthesis:

=DateDiff("d", [DateIn], NZ([DateOut], Date()))

>
> This assumes that DateIn will always have a date; if it might be null,
>
> =IIF(IsNull([DateIn], Null, DateDiff("d", [DateIn], NZ([DateOut], Date()))

You're missing a closing parenthesis for the IsNull function call (in
addition to the closing parenthesis for the DateDiff function call)

=IIF(IsNull([DateIn]), Null, DateDiff("d", [DateIn], NZ([DateOut], Date())))


From: John W. Vinson on
On Wed, 24 Mar 2010 07:12:21 -0400, "Douglas J. Steele"
<NOSPAM_djsteele(a)NOSPAM_gmail.com> wrote:

>Time to get your prescription checked, John? <g>

<blush> Thanks for the catch, Douglas.

--

John W. Vinson [MVP]
From: JOSELUIS via AccessMonster.com on
John W. Vinson wrote:
>>Time to get your prescription checked, John? <g>
>
><blush> Thanks for the catch, Douglas.
>
Thank you very much now it works perfectly. This Easter holidays I pray for
all of you in my way to Santiago.

--
Message posted via http://www.accessmonster.com