PC Review


Reply
Thread Tools Rate Thread

Days calculation going haywire

 
 
=?Utf-8?B?TnVtZnJpYw==?=
Guest
Posts: n/a
 
      29th Mar 2006
I ran an Office update a couple of days ago, and suddenly a formula is
producing an incorrect answer intermittently:
Due Date: [From
date]-IIf([Country]="",IIf([nights]>20,90,60),IIf([nights]>10,90,60))

In most cases the calculation is correct, but about once in 5 cases, it's
calculating a difference of 30 days instead of 60. You will notice there is
no mention of 30 in the formula. I've gone back to the confirmation letters
that printed out from this query, and they are all correct until the one I
sent out today (the first one I've sent out since the update), but the values
in the query are now incorrect. It looks like all the From dates are in
December through February, where the calculation is incorrect.
 
Reply With Quote
 
 
 
 
TC
Guest
Posts: n/a
 
      29th Mar 2006
It's a bit hard to comment on this, unless you can cite an exact
example of where it went wrong. And also show the SQL from the query
concerned.

Access queries just don't go bad, & produce the wrong information. Not
to be rude, but, it is 99.9% certain that it is doing just what you
asked it to.

HTH,
TC (MVP Access)
http://tc2.atspace.com

 
Reply With Quote
 
=?Utf-8?B?TnVtZnJpYw==?=
Guest
Posts: n/a
 
      29th Mar 2006
Well, it turns out it's not the query that has it wrong, it's the value in
the form, which gets the value of Due Date from the query. How can this
happen?

"Numfric" wrote:

> I ran an Office update a couple of days ago, and suddenly a formula is
> producing an incorrect answer intermittently:
> Due Date: [From
> date]-IIf([Country]="",IIf([nights]>20,90,60),IIf([nights]>10,90,60))
>
> In most cases the calculation is correct, but about once in 5 cases, it's
> calculating a difference of 30 days instead of 60. You will notice there is
> no mention of 30 in the formula. I've gone back to the confirmation letters
> that printed out from this query, and they are all correct until the one I
> sent out today (the first one I've sent out since the update), but the values
> in the query are now incorrect. It looks like all the From dates are in
> December through February, where the calculation is incorrect.

 
Reply With Quote
 
=?Utf-8?B?TnVtZnJpYw==?=
Guest
Posts: n/a
 
      29th Mar 2006
Never mind. I decided, about a month ago, to create a new query, based on
the previous one, but only including rows with a From date within the past 12
months. Evidently I decided also to "simplify" the due date calculation to
be Due Date: [From date]-(30+(30*Int([nights]/7))), so now anyone that books
less than a week gets a break on the due date. NOT what I intended.
Groan. I really shouldn't be doing this past my bedtime!

"Numfric" wrote:

> Well, it turns out it's not the query that has it wrong, it's the value in
> the form, which gets the value of Due Date from the query. How can this
> happen?
>
> "Numfric" wrote:
>
> > I ran an Office update a couple of days ago, and suddenly a formula is
> > producing an incorrect answer intermittently:
> > Due Date: [From
> > date]-IIf([Country]="",IIf([nights]>20,90,60),IIf([nights]>10,90,60))
> >
> > In most cases the calculation is correct, but about once in 5 cases, it's
> > calculating a difference of 30 days instead of 60. You will notice there is
> > no mention of 30 in the formula. I've gone back to the confirmation letters
> > that printed out from this query, and they are all correct until the one I
> > sent out today (the first one I've sent out since the update), but the values
> > in the query are now incorrect. It looks like all the From dates are in
> > December through February, where the calculation is incorrect.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Days Calculation Firoz Khan Microsoft Excel Misc 11 10th Aug 2009 12:29 PM
days calculation Yousoft Microsoft Excel New Users 3 6th Nov 2008 12:51 PM
How to calculation no. of days (only working days) between two dat =?Utf-8?B?Vml2aWFuIENoYW4=?= Microsoft Excel Misc 1 26th Jul 2007 09:16 AM
Please Help With Days Elapsed And Days Remaining Calculation Scoooter Microsoft Excel Worksheet Functions 2 14th Jun 2006 05:10 PM
Days between calculation =?Utf-8?B?TWFya1c=?= Microsoft Access Queries 1 26th Feb 2005 03:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:56 AM.