Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-12-2008, 06:15 AM
Bob Vance
 
Posts: n/a
Query by Dates Problem

My query has 3 fields
1-OwnerID, Group by
2-Dues: AmountSummary, Sum of what he totaly owes
3-MD:
IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)))
Not working properly trying to get 1,2,3, Overdue Totals, What do you think
looks wrong!
--
Thanks in advance for any help with this......Bob
WindowsXP..MS Access 2007


Reply With Quote
  #2 (permalink)  
Old 08-12-2008, 06:21 AM
Bob Vance
 
Posts: n/a
Re: Query by Dates Problem

Oops Sorry forgot to show the SQL
SELECT qOwnerPercentAmountInPaymentMethod.OwnerID,
Sum(qOwnerPercentAmountInPaymentMethod.AmountSumma ry) AS Dues,
IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)))
AS MD
FROM qOwnerPercentAmountInPaymentMethod
GROUP BY qOwnerPercentAmountInPaymentMethod.OwnerID,
IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)));

"Bob Vance" <rjvance@ihug.co.nz> wrote in message
news:ujFznpD$IHA.3648@TK2MSFTNGP02.phx.gbl...
> My query has 3 fields
> 1-OwnerID, Group by
> 2-Dues: AmountSummary, Sum of what he totaly owes
> 3-MD:
> IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)))
> Not working properly trying to get 1,2,3, Overdue Totals, What do you
> think looks wrong!
> --
> Thanks in advance for any help with this......Bob
> WindowsXP..MS Access 2007
>



Reply With Quote
  #3 (permalink)  
Old 08-12-2008, 07:02 AM
pietlinden@hotmail.com
 
Posts: n/a
Re: Query by Dates Problem

On Aug 12, 12:21*am, "Bob Vance" <rjva...@ihug.co.nz> wrote:
> Oops Sorry forgot to show the SQL
> SELECT qOwnerPercentAmountInPaymentMethod.OwnerID,
> Sum(qOwnerPercentAmountInPaymentMethod.AmountSumma ry) AS Dues,
> IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)))
> AS MD
> FROM qOwnerPercentAmountInPaymentMethod
> GROUP BY qOwnerPercentAmountInPaymentMethod.OwnerID,
> IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)));
>
> "Bob Vance" <rjva...@ihug.co.nz> wrote in message
>
> news:ujFznpD$IHA.3648@TK2MSFTNGP02.phx.gbl...
>
> > My query has 3 fields
> > 1-OwnerID, Group by
> > 2-Dues: AmountSummary, Sum of what he totaly owes
> > 3-MD:
> > IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)))
> > Not working properly trying to get 1,2,3, Overdue Totals, What do you
> > think looks wrong!
> > --
> > Thanks in advance for any help with this......Bob
> > WindowsXP..MS Access 2007


SELECT tDues.MemberID, tDues.DueDate, tDues.AmountDue, tDues.DatePaid,
IIf(IsNull([DatePaid]),DateDiff("d",[tDues]![DueDate],Date()),0) AS
DaysOverdue, IIf(IsNull([DatePaid]),DateDiff("m",[tDues]!
[DueDate],Date()),0) AS MonthsOverdue
FROM tDues;
Reply With Quote
  #4 (permalink)  
Old 08-12-2008, 08:05 AM
Bob Vance
 
Posts: n/a
Re: Query by Dates Problem

Ok Peter my systerm is a bit different it does not have a due date but
calculates from Today()
<pietlinden@hotmail.com> wrote in message
news:7c8d3bc6-d4fe-4b29-944d-e8fc96f2f875@x35g2000hsb.googlegroups.com...
On Aug 12, 12:21 am, "Bob Vance" <rjva...@ihug.co.nz> wrote:
> Oops Sorry forgot to show the SQL
> SELECT qOwnerPercentAmountInPaymentMethod.OwnerID,
> Sum(qOwnerPercentAmountInPaymentMethod.AmountSumma ry) AS Dues,
> IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)))
> AS MD
> FROM qOwnerPercentAmountInPaymentMethod
> GROUP BY qOwnerPercentAmountInPaymentMethod.OwnerID,
> IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)));
>
> "Bob Vance" <rjva...@ihug.co.nz> wrote in message
>
> news:ujFznpD$IHA.3648@TK2MSFTNGP02.phx.gbl...
>
> > My query has 3 fields
> > 1-OwnerID, Group by
> > 2-Dues: AmountSummary, Sum of what he totaly owes
> > 3-MD:
> > IIf((Date()-[ondate])/30>=3,3,IIf((Date()-[ondate])/30>=2,2,IIf((Date()-[ondate])/30>=1,1,0)))
> > Not working properly trying to get 1,2,3, Overdue Totals, What do you
> > think looks wrong!
> > --
> > Thanks in advance for any help with this......Bob
> > WindowsXP..MS Access 2007


SELECT tDues.MemberID, tDues.DueDate, tDues.AmountDue, tDues.DatePaid,
IIf(IsNull([DatePaid]),DateDiff("d",[tDues]![DueDate],Date()),0) AS
DaysOverdue, IIf(IsNull([DatePaid]),DateDiff("m",[tDues]!
[DueDate],Date()),0) AS MonthsOverdue
FROM tDues;

Ok Peter my systerm is a bit different it does not have a due date but
calculates from Today()
Thanks anyway for the help,,,,,,,Bob


Reply With Quote
  #5 (permalink)  
Old 08-12-2008, 08:36 AM
pietlinden@hotmail.com
 
Posts: n/a
Re: Query by Dates Problem

On Aug 12, 2:05*am, "Bob Vance" <rjva...@ihug.co.nz> wrote:
> Ok Peter my systerm is a bit different it does not have a due date but
> calculates from Today()<pietlin...@hotmail.com> wrote in message


Huh? Mine calculates from today too... that's that Date() is.

So you're trying to aging? Sounds like you need 3 DSUMS with
different criteria.
DatePaid is False/Null whatever,
then the ranges for each are different.

You mean something like this:
TRANSFORM Sum(Query2.AmountDue) AS SumOfAmountDue
SELECT Query2.MemberID, Sum(Query2.AmountDue) AS [Total Of AmountDue]
FROM Query2
GROUP BY Query2.MemberID
PIVOT Query2.MonthsOverdue;

based on this (Query2 SQL):

SELECT tDues.MemberID, tDues.DueDate, tDues.AmountDue, tDues.DatePaid,
IIf(IsNull([DatePaid]),DateDiff("d",tDues!DueDate,Date()),0) AS
DaysOverdue, IIf(IsNull([DatePaid]),DateDiff("d",[tDues]!
[DueDate],Date()),0)\30 AS MonthsOverdue
FROM tDues
WHERE (((IIf(IsNull([DatePaid]),DateDiff("d",[tDues]![DueDate],Date()),
0)\30)>0));
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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



All times are GMT. The time now is 04:52 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Problem Mortgage | Mortgage | Loans | Loans | Hosting



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114