On Time Delivery Query

J

John Torres

I'm trying to create a query for "On Time Delivery". I have query fields of
PO, Date Received, Due Date and Date Shipped. I'd like to calculate EARLY
(shipped 3 days early from the due date), On Time (Shipped on Due Date or 2
days early) and LATE (Shipped past Due Date) and on a business days only
(excluding Saturday and Sunday). These are all coming from 3 different
tables. I would appreciate any ideas.

Thanks,

John
 
A

Al Campagna

John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

John Torres

WOW.....Thanks for the quick response and it works. I was amazed!


Al Campagna said:
John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
I'm trying to create a query for "On Time Delivery". I have query fields
of PO, Date Received, Due Date and Date Shipped. I'd like to calculate
EARLY (shipped 3 days early from the due date), On Time (Shipped on Due
Date or 2 days early) and LATE (Shipped past Due Date) and on a business
days only (excluding Saturday and Sunday). These are all coming from 3
different tables. I would appreciate any ideas.

Thanks,

John
 
J

John Torres

Is there any way to summarize the total of Early, On Time and Late on the
query or report?
Thanks again!
John


John Torres said:
WOW.....Thanks for the quick response and it works. I was amazed!


Al Campagna said:
John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
I'm trying to create a query for "On Time Delivery". I have query fields
of PO, Date Received, Due Date and Date Shipped. I'd like to calculate
EARLY (shipped 3 days early from the due date), On Time (Shipped on Due
Date or 2 days early) and LATE (Shipped past Due Date) and on a business
days only (excluding Saturday and Sunday). These are all coming from 3
different tables. I would appreciate any ideas.

Thanks,

John
 
A

Al Campagna

John,
You could apply my calculation and bind the value to a field name like
ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for whatever
Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of all records.
So... given that you know how many records there are, and the count of
each ShipStatus type, you can now calculate the percentages of each
ShipStatus.
Which (I'll bet a nickel) is probably what you're really looking for
after all...

Given what I know about this report, I would consider breaking out the
Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout has better
visual impact than just a 1column dump. You might notice a pattern of
Lates early in each week, or certain times of the month... yadayada. Just a
suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
Is there any way to summarize the total of Early, On Time and Late on the
query or report?
Thanks again!
John


John Torres said:
WOW.....Thanks for the quick response and it works. I was amazed!


Al Campagna said:
John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


I'm trying to create a query for "On Time Delivery". I have query
fields of PO, Date Received, Due Date and Date Shipped. I'd like to
calculate EARLY (shipped 3 days early from the due date), On Time
(Shipped on Due Date or 2 days early) and LATE (Shipped past Due Date)
and on a business days only (excluding Saturday and Sunday). These are
all coming from 3 different tables. I would appreciate any ideas.

Thanks,

John
 
J

John Torres

THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

Al Campagna said:
John,
You could apply my calculation and bind the value to a field name like
ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for whatever
Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of all
records.
So... given that you know how many records there are, and the count of
each ShipStatus type, you can now calculate the percentages of each
ShipStatus.
Which (I'll bet a nickel) is probably what you're really looking for
after all...

Given what I know about this report, I would consider breaking out the
Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout has better
visual impact than just a 1column dump. You might notice a pattern of
Lates early in each week, or certain times of the month... yadayada. Just
a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
Is there any way to summarize the total of Early, On Time and Late on the
query or report?
Thanks again!
John


John Torres said:
WOW.....Thanks for the quick response and it works. I was amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


I'm trying to create a query for "On Time Delivery". I have query
fields of PO, Date Received, Due Date and Date Shipped. I'd like to
calculate EARLY (shipped 3 days early from the due date), On Time
(Shipped on Due Date or 2 days early) and LATE (Shipped past Due Date)
and on a business days only (excluding Saturday and Sunday). These are
all coming from 3 different tables. I would appreciate any ideas.

Thanks,

John
 
J

John Torres

I didn't work with the part where =Sum(IIf([Status]="On Time",1,0)). It
shows as a text when you preview the report. Same thing with the =Count(*).
Sorry I'm a newbie. I probably misunderstood some of the details.
Thanks again and I will try it again.
John

John Torres said:
THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

Al Campagna said:
John,
You could apply my calculation and bind the value to a field name like
ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for whatever
Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of all
records.
So... given that you know how many records there are, and the count of
each ShipStatus type, you can now calculate the percentages of each
ShipStatus.
Which (I'll bet a nickel) is probably what you're really looking for
after all...

Given what I know about this report, I would consider breaking out the
Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout has better
visual impact than just a 1column dump. You might notice a pattern of
Lates early in each week, or certain times of the month... yadayada.
Just a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
Is there any way to summarize the total of Early, On Time and Late on
the query or report?
Thanks again!
John


WOW.....Thanks for the quick response and it works. I was amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


I'm trying to create a query for "On Time Delivery". I have query
fields of PO, Date Received, Due Date and Date Shipped. I'd like to
calculate EARLY (shipped 3 days early from the due date), On Time
(Shipped on Due Date or 2 days early) and LATE (Shipped past Due
Date) and on a business days only (excluding Saturday and Sunday).
These are all coming from 3 different tables. I would appreciate any
ideas.

Thanks,

John
 
A

Al Campagna

John,
The totals for each group should be done on the report footers, not the
query.

Place an unbound Text Control (ex. name = totEarly), in whatever Group
Footer section you want totals for.
Make the ControlSource of that text control...
= Sum(IIf([Status]="On Time",1,0))
that will yield a count of Early in that group.

Repeat that process with another unbound text control (ex. name = totAll),
with a ControlSource of...
= Sum(*)
that will yield a count of all records in that group.

If you still have problems, I need you to explain exactly what you did,
where you did it, and the code involved.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

John Torres said:
I didn't work with the part where =Sum(IIf([Status]="On Time",1,0)). It
shows as a text when you preview the report. Same thing with the =Count(*).
Sorry I'm a newbie. I probably misunderstood some of the details.
Thanks again and I will try it again.
John

John Torres said:
THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

Al Campagna said:
John,
You could apply my calculation and bind the value to a field name like
ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for
whatever Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of all
records.
So... given that you know how many records there are, and the count of
each ShipStatus type, you can now calculate the percentages of each
ShipStatus.
Which (I'll bet a nickel) is probably what you're really looking for
after all...

Given what I know about this report, I would consider breaking out
the Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout has
better visual impact than just a 1column dump. You might notice a
pattern of Lates early in each week, or certain times of the month...
yadayada. Just a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Is there any way to summarize the total of Early, On Time and Late on
the query or report?
Thanks again!
John


WOW.....Thanks for the quick response and it works. I was amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


I'm trying to create a query for "On Time Delivery". I have query
fields of PO, Date Received, Due Date and Date Shipped. I'd like to
calculate EARLY (shipped 3 days early from the due date), On Time
(Shipped on Due Date or 2 days early) and LATE (Shipped past Due
Date) and on a business days only (excluding Saturday and Sunday).
These are all coming from 3 different tables. I would appreciate any
ideas.

Thanks,

John
 
J

John Torres

Thanks again - it works. Thanks so much for your help!

Al Campagna said:
John,
The totals for each group should be done on the report footers, not the
query.

Place an unbound Text Control (ex. name = totEarly), in whatever Group
Footer section you want totals for.
Make the ControlSource of that text control...
= Sum(IIf([Status]="On Time",1,0))
that will yield a count of Early in that group.

Repeat that process with another unbound text control (ex. name =
totAll), with a ControlSource of...
= Sum(*)
that will yield a count of all records in that group.

If you still have problems, I need you to explain exactly what you did,
where you did it, and the code involved.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

John Torres said:
I didn't work with the part where =Sum(IIf([Status]="On Time",1,0)). It
shows as a text when you preview the report. Same thing with the
=Count(*). Sorry I'm a newbie. I probably misunderstood some of the
details.
Thanks again and I will try it again.
John

John Torres said:
THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

John,
You could apply my calculation and bind the value to a field name
like ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for
whatever Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of all
records.
So... given that you know how many records there are, and the count
of each ShipStatus type, you can now calculate the percentages of each
ShipStatus.
Which (I'll bet a nickel) is probably what you're really looking for
after all...

Given what I know about this report, I would consider breaking out
the Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout has
better visual impact than just a 1column dump. You might notice a
pattern of Lates early in each week, or certain times of the month...
yadayada. Just a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Is there any way to summarize the total of Early, On Time and Late on
the query or report?
Thanks again!
John


WOW.....Thanks for the quick response and it works. I was amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


I'm trying to create a query for "On Time Delivery". I have query
fields of PO, Date Received, Due Date and Date Shipped. I'd like to
calculate EARLY (shipped 3 days early from the due date), On Time
(Shipped on Due Date or 2 days early) and LATE (Shipped past Due
Date) and on a business days only (excluding Saturday and Sunday).
These are all coming from 3 different tables. I would appreciate
any ideas.

Thanks,

John
 
A

Al Campagna

John,
I just noticed a mistype in my last post...
that will yield a count of Early in that group. Should have read...
that will yield a count of "On Time" in that group.

Glad you got going OK...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

John Torres said:
Thanks again - it works. Thanks so much for your help!

Al Campagna said:
John,
The totals for each group should be done on the report footers, not
the query.

Place an unbound Text Control (ex. name = totEarly), in whatever Group
Footer section you want totals for.
Make the ControlSource of that text control...
= Sum(IIf([Status]="On Time",1,0))
that will yield a count of Early in that group.

Repeat that process with another unbound text control (ex. name =
totAll), with a ControlSource of...
= Sum(*)
that will yield a count of all records in that group.

If you still have problems, I need you to explain exactly what you
did, where you did it, and the code involved.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

John Torres said:
I didn't work with the part where =Sum(IIf([Status]="On Time",1,0)). It
shows as a text when you preview the report. Same thing with the
=Count(*). Sorry I'm a newbie. I probably misunderstood some of the
details.
Thanks again and I will try it again.
John

THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

John,
You could apply my calculation and bind the value to a field name
like ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for
whatever Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of all
records.
So... given that you know how many records there are, and the count
of each ShipStatus type, you can now calculate the percentages of each
ShipStatus.
Which (I'll bet a nickel) is probably what you're really looking for
after all...

Given what I know about this report, I would consider breaking out
the Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout has
better visual impact than just a 1column dump. You might notice a
pattern of Lates early in each week, or certain times of the month...
yadayada. Just a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Is there any way to summarize the total of Early, On Time and Late on
the query or report?
Thanks again!
John


WOW.....Thanks for the quick response and it works. I was amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


I'm trying to create a query for "On Time Delivery". I have query
fields of PO, Date Received, Due Date and Date Shipped. I'd like
to calculate EARLY (shipped 3 days early from the due date), On
Time (Shipped on Due Date or 2 days early) and LATE (Shipped past
Due Date) and on a business days only (excluding Saturday and
Sunday). These are all coming from 3 different tables. I would
appreciate any ideas.

Thanks,

John
 
J

John Torres

Al,
If I want to change my criteria of Late (Late = past due date and + 2 days
from due date) how do i write that? I tried to modify and it does'nt
work.......
Here's the original code:
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))
Thanks again.
John


Al Campagna said:
John,
I just noticed a mistype in my last post...
that will yield a count of Early in that group. Should have read...
that will yield a count of "On Time" in that group.

Glad you got going OK...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

John Torres said:
Thanks again - it works. Thanks so much for your help!

Al Campagna said:
John,
The totals for each group should be done on the report footers, not
the query.

Place an unbound Text Control (ex. name = totEarly), in whatever
Group Footer section you want totals for.
Make the ControlSource of that text control...
= Sum(IIf([Status]="On Time",1,0))
that will yield a count of Early in that group.

Repeat that process with another unbound text control (ex. name =
totAll), with a ControlSource of...
= Sum(*)
that will yield a count of all records in that group.

If you still have problems, I need you to explain exactly what you
did, where you did it, and the code involved.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

I didn't work with the part where =Sum(IIf([Status]="On Time",1,0)). It
shows as a text when you preview the report. Same thing with the
=Count(*). Sorry I'm a newbie. I probably misunderstood some of the
details.
Thanks again and I will try it again.
John

THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

John,
You could apply my calculation and bind the value to a field name
like ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for
whatever Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of all
records.
So... given that you know how many records there are, and the count
of each ShipStatus type, you can now calculate the percentages of
each ShipStatus.
Which (I'll bet a nickel) is probably what you're really looking
for after all...

Given what I know about this report, I would consider breaking out
the Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout has
better visual impact than just a 1column dump. You might notice a
pattern of Lates early in each week, or certain times of the month...
yadayada. Just a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Is there any way to summarize the total of Early, On Time and Late
on the query or report?
Thanks again!
John


WOW.....Thanks for the quick response and it works. I was amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


I'm trying to create a query for "On Time Delivery". I have query
fields of PO, Date Received, Due Date and Date Shipped. I'd like
to calculate EARLY (shipped 3 days early from the due date), On
Time (Shipped on Due Date or 2 days early) and LATE (Shipped past
Due Date) and on a business days only (excluding Saturday and
Sunday). These are all coming from 3 different tables. I would
appreciate any ideas.

Thanks,

John
 
A

Al Campagna

John,
First, you don't indicate exactly what code you tried, and... "doesn't
work" is not descriptive of what really happened.
You wrote...
If I want to change my criteria of Late (Late = past due date and + 2 days
from due date) how do i write that?
Where did the Past Due Date come from? That's not in your original list
of fields.
Example dates and example Statuses would also be helpful, as I do not
understand what you're saying about the "Late" logic.
------------------
There is no calculation in the IIF Statement as to LATE. My logic
states...
"If a ShipDate is NOT "Early", and a ShipDate is NOT "On Time"... then
it must be "Late"
That's the "fallout" (no logic satisfied) of the IIF statement.

Try adjusting your "Early" and/or "OnTime" logic to cause the IFF to
properly fallout to "Late"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
Al,
If I want to change my criteria of Late (Late = past due date and + 2 days
from due date) how do i write that? I tried to modify and it does'nt
work.......
Here's the original code:
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))
Thanks again.
John


Al Campagna said:
John,
I just noticed a mistype in my last post...
that will yield a count of Early in that group. Should have read...
that will yield a count of "On Time" in that group.

Glad you got going OK...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

John Torres said:
Thanks again - it works. Thanks so much for your help!

John,
The totals for each group should be done on the report footers, not
the query.

Place an unbound Text Control (ex. name = totEarly), in whatever
Group Footer section you want totals for.
Make the ControlSource of that text control...
= Sum(IIf([Status]="On Time",1,0))
that will yield a count of Early in that group.

Repeat that process with another unbound text control (ex. name =
totAll), with a ControlSource of...
= Sum(*)
that will yield a count of all records in that group.

If you still have problems, I need you to explain exactly what you
did, where you did it, and the code involved.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

I didn't work with the part where =Sum(IIf([Status]="On Time",1,0)). It
shows as a text when you preview the report. Same thing with the
=Count(*). Sorry I'm a newbie. I probably misunderstood some of the
details.
Thanks again and I will try it again.
John

THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

John,
You could apply my calculation and bind the value to a field name
like ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for
whatever Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of all
records.
So... given that you know how many records there are, and the
count of each ShipStatus type, you can now calculate the percentages
of each ShipStatus.
Which (I'll bet a nickel) is probably what you're really looking
for after all...

Given what I know about this report, I would consider breaking
out the Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout has
better visual impact than just a 1column dump. You might notice a
pattern of Lates early in each week, or certain times of the
month... yadayada. Just a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Is there any way to summarize the total of Early, On Time and Late
on the query or report?
Thanks again!
John


WOW.....Thanks for the quick response and it works. I was amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do
it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


I'm trying to create a query for "On Time Delivery". I have
query fields of PO, Date Received, Due Date and Date Shipped.
I'd like to calculate EARLY (shipped 3 days early from the due
date), On Time (Shipped on Due Date or 2 days early) and LATE
(Shipped past Due Date) and on a business days only (excluding
Saturday and Sunday). These are all coming from 3 different
tables. I would appreciate any ideas.

Thanks,

John
 
J

John Torres

Hi Al,
Sorry about the confusion, I didn't understand the logic behind it now I
understand. My question should have been how do you add 2 days later on the
"On Time". On Time=Shipped on DueDate or 2 days early and 2 days later from
due date.

Currently what I have is "On Time (Shipped on Due Date or 2 days early)". I
tried adding +2 in expressions (...("d",-2,+2,DueDate])......That didn't
work.
Thanks again! Apprciate it so much!
John

IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))



Al Campagna said:
John,
First, you don't indicate exactly what code you tried, and... "doesn't
work" is not descriptive of what really happened.
You wrote...
If I want to change my criteria of Late (Late = past due date and + 2 days
from due date) how do i write that?
Where did the Past Due Date come from? That's not in your original
list of fields.
Example dates and example Statuses would also be helpful, as I do not
understand what you're saying about the "Late" logic.
------------------
There is no calculation in the IIF Statement as to LATE. My logic
states...
"If a ShipDate is NOT "Early", and a ShipDate is NOT "On Time"... then
it must be "Late"
That's the "fallout" (no logic satisfied) of the IIF statement.

Try adjusting your "Early" and/or "OnTime" logic to cause the IFF to
properly fallout to "Late"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
Al,
If I want to change my criteria of Late (Late = past due date and + 2
days from due date) how do i write that? I tried to modify and it does'nt
work.......
Here's the original code:
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))
Thanks again.
John


Al Campagna said:
John,
I just noticed a mistype in my last post...
that will yield a count of Early in that group.
Should have read...
that will yield a count of "On Time" in that group.

Glad you got going OK...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

Thanks again - it works. Thanks so much for your help!

John,
The totals for each group should be done on the report footers, not
the query.

Place an unbound Text Control (ex. name = totEarly), in whatever
Group Footer section you want totals for.
Make the ControlSource of that text control...
= Sum(IIf([Status]="On Time",1,0))
that will yield a count of Early in that group.

Repeat that process with another unbound text control (ex. name =
totAll), with a ControlSource of...
= Sum(*)
that will yield a count of all records in that group.

If you still have problems, I need you to explain exactly what you
did, where you did it, and the code involved.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

I didn't work with the part where =Sum(IIf([Status]="On Time",1,0)).
It shows as a text when you preview the report. Same thing with the
=Count(*). Sorry I'm a newbie. I probably misunderstood some of the
details.
Thanks again and I will try it again.
John

THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

John,
You could apply my calculation and bind the value to a field name
like ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for
whatever Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of all
records.
So... given that you know how many records there are, and the
count of each ShipStatus type, you can now calculate the
percentages of each ShipStatus.
Which (I'll bet a nickel) is probably what you're really looking
for after all...

Given what I know about this report, I would consider breaking
out the Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout has
better visual impact than just a 1column dump. You might notice a
pattern of Lates early in each week, or certain times of the
month... yadayada. Just a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Is there any way to summarize the total of Early, On Time and Late
on the query or report?
Thanks again!
John


WOW.....Thanks for the quick response and it works. I was amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do
it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


I'm trying to create a query for "On Time Delivery". I have
query fields of PO, Date Received, Due Date and Date Shipped.
I'd like to calculate EARLY (shipped 3 days early from the due
date), On Time (Shipped on Due Date or 2 days early) and LATE
(Shipped past Due Date) and on a business days only (excluding
Saturday and Sunday). These are all coming from 3 different
tables. I would appreciate any ideas.

Thanks,

John
 
A

Al Campagna

John,
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=DateAdd("d",+2,[DueDate],"On Time","Late"))

Says...
If ShippedDate is 3 days or more less than DueDate = Early
If ShippedDate is between DueDate -2 days before and DueDate + 2 days after
= OnTime
Anything else... Late

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
Hi Al,
Sorry about the confusion, I didn't understand the logic behind it now I
understand. My question should have been how do you add 2 days later on
the "On Time". On Time=Shipped on DueDate or 2 days early and 2 days later
from due date.

Currently what I have is "On Time (Shipped on Due Date or 2 days early)".
I tried adding +2 in expressions (...("d",-2,+2,DueDate])......That didn't
work.
Thanks again! Apprciate it so much!
John

IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))



Al Campagna said:
John,
First, you don't indicate exactly what code you tried, and... "doesn't
work" is not descriptive of what really happened.
You wrote...
If I want to change my criteria of Late (Late = past due date and + 2 days
from due date) how do i write that?
Where did the Past Due Date come from? That's not in your original
list of fields.
Example dates and example Statuses would also be helpful, as I do not
understand what you're saying about the "Late" logic.
------------------
There is no calculation in the IIF Statement as to LATE. My logic
states...
"If a ShipDate is NOT "Early", and a ShipDate is NOT "On Time"... then
it must be "Late"
That's the "fallout" (no logic satisfied) of the IIF statement.

Try adjusting your "Early" and/or "OnTime" logic to cause the IFF to
properly fallout to "Late"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
Al,
If I want to change my criteria of Late (Late = past due date and + 2
days from due date) how do i write that? I tried to modify and it
does'nt work.......
Here's the original code:
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))
Thanks again.
John


John,
I just noticed a mistype in my last post...
that will yield a count of Early in that group.
Should have read...
that will yield a count of "On Time" in that group.

Glad you got going OK...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

Thanks again - it works. Thanks so much for your help!

John,
The totals for each group should be done on the report footers,
not the query.

Place an unbound Text Control (ex. name = totEarly), in whatever
Group Footer section you want totals for.
Make the ControlSource of that text control...
= Sum(IIf([Status]="On Time",1,0))
that will yield a count of Early in that group.

Repeat that process with another unbound text control (ex. name =
totAll), with a ControlSource of...
= Sum(*)
that will yield a count of all records in that group.

If you still have problems, I need you to explain exactly what you
did, where you did it, and the code involved.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

I didn't work with the part where =Sum(IIf([Status]="On Time",1,0)).
It shows as a text when you preview the report. Same thing with the
=Count(*). Sorry I'm a newbie. I probably misunderstood some of the
details.
Thanks again and I will try it again.
John

THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

John,
You could apply my calculation and bind the value to a field
name like ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for
whatever Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of all
records.
So... given that you know how many records there are, and the
count of each ShipStatus type, you can now calculate the
percentages of each ShipStatus.
Which (I'll bet a nickel) is probably what you're really looking
for after all...

Given what I know about this report, I would consider breaking
out the Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout has
better visual impact than just a 1column dump. You might notice a
pattern of Lates early in each week, or certain times of the
month... yadayada. Just a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Is there any way to summarize the total of Early, On Time and
Late on the query or report?
Thanks again!
John


WOW.....Thanks for the quick response and it works. I was
amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do
it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


I'm trying to create a query for "On Time Delivery". I have
query fields of PO, Date Received, Due Date and Date Shipped.
I'd like to calculate EARLY (shipped 3 days early from the due
date), On Time (Shipped on Due Date or 2 days early) and LATE
(Shipped past Due Date) and on a business days only (excluding
Saturday and Sunday). These are all coming from 3 different
tables. I would appreciate any ideas.

Thanks,

John
 
J

John Torres

Thanks Al! I appreciate it so much. And Thanks for explaining the whole
logic behind it. I'm learning so much from this group specially for people
like you.
John


Al Campagna said:
John,
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=DateAdd("d",+2,[DueDate],"On Time","Late"))

Says...
If ShippedDate is 3 days or more less than DueDate = Early
If ShippedDate is between DueDate -2 days before and DueDate + 2 days
after = OnTime
Anything else... Late

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
Hi Al,
Sorry about the confusion, I didn't understand the logic behind it now I
understand. My question should have been how do you add 2 days later on
the "On Time". On Time=Shipped on DueDate or 2 days early and 2 days
later from due date.

Currently what I have is "On Time (Shipped on Due Date or 2 days early)".
I tried adding +2 in expressions (...("d",-2,+2,DueDate])......That
didn't work.
Thanks again! Apprciate it so much!
John

IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))



Al Campagna said:
John,
First, you don't indicate exactly what code you tried, and...
"doesn't work" is not descriptive of what really happened.
You wrote...
If I want to change my criteria of Late (Late = past due date and + 2
days
from due date) how do i write that?
Where did the Past Due Date come from? That's not in your original
list of fields.
Example dates and example Statuses would also be helpful, as I do not
understand what you're saying about the "Late" logic.
------------------
There is no calculation in the IIF Statement as to LATE. My logic
states...
"If a ShipDate is NOT "Early", and a ShipDate is NOT "On Time"...
then it must be "Late"
That's the "fallout" (no logic satisfied) of the IIF statement.

Try adjusting your "Early" and/or "OnTime" logic to cause the IFF to
properly fallout to "Late"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Al,
If I want to change my criteria of Late (Late = past due date and + 2
days from due date) how do i write that? I tried to modify and it
does'nt work.......
Here's the original code:
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))
Thanks again.
John


John,
I just noticed a mistype in my last post...
that will yield a count of Early in that group.
Should have read...
that will yield a count of "On Time" in that group.

Glad you got going OK...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

Thanks again - it works. Thanks so much for your help!

John,
The totals for each group should be done on the report footers,
not the query.

Place an unbound Text Control (ex. name = totEarly), in whatever
Group Footer section you want totals for.
Make the ControlSource of that text control...
= Sum(IIf([Status]="On Time",1,0))
that will yield a count of Early in that group.

Repeat that process with another unbound text control (ex. name =
totAll), with a ControlSource of...
= Sum(*)
that will yield a count of all records in that group.

If you still have problems, I need you to explain exactly what
you did, where you did it, and the code involved.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

I didn't work with the part where =Sum(IIf([Status]="On Time",1,0)).
It shows as a text when you preview the report. Same thing with the
=Count(*). Sorry I'm a newbie. I probably misunderstood some of the
details.
Thanks again and I will try it again.
John

THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

John,
You could apply my calculation and bind the value to a field
name like ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for
whatever Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of
all records.
So... given that you know how many records there are, and the
count of each ShipStatus type, you can now calculate the
percentages of each ShipStatus.
Which (I'll bet a nickel) is probably what you're really
looking for after all...

Given what I know about this report, I would consider breaking
out the Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout
has better visual impact than just a 1column dump. You might
notice a pattern of Lates early in each week, or certain times of
the month... yadayada. Just a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Is there any way to summarize the total of Early, On Time and
Late on the query or report?
Thanks again!
John


WOW.....Thanks for the quick response and it works. I was
amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should do
it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


message
I'm trying to create a query for "On Time Delivery". I have
query fields of PO, Date Received, Due Date and Date Shipped.
I'd like to calculate EARLY (shipped 3 days early from the
due date), On Time (Shipped on Due Date or 2 days early) and
LATE (Shipped past Due Date) and on a business days only
(excluding Saturday and Sunday). These are all coming from 3
different tables. I would appreciate any ideas.

Thanks,

John
 
A

Al Campagna

John,
You're welcome, and glad you got going.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

John Torres said:
Thanks Al! I appreciate it so much. And Thanks for explaining the whole
logic behind it. I'm learning so much from this group specially for people
like you.
John


Al Campagna said:
John,
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=DateAdd("d",+2,[DueDate],"On Time","Late"))

Says...
If ShippedDate is 3 days or more less than DueDate = Early
If ShippedDate is between DueDate -2 days before and DueDate + 2 days
after = OnTime
Anything else... Late

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


John Torres said:
Hi Al,
Sorry about the confusion, I didn't understand the logic behind it now I
understand. My question should have been how do you add 2 days later on
the "On Time". On Time=Shipped on DueDate or 2 days early and 2 days
later from due date.

Currently what I have is "On Time (Shipped on Due Date or 2 days
early)". I tried adding +2 in expressions
(...("d",-2,+2,DueDate])......That didn't work.
Thanks again! Apprciate it so much!
John

IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))



John,
First, you don't indicate exactly what code you tried, and...
"doesn't work" is not descriptive of what really happened.
You wrote...
If I want to change my criteria of Late (Late = past due date and + 2
days
from due date) how do i write that?
Where did the Past Due Date come from? That's not in your original
list of fields.
Example dates and example Statuses would also be helpful, as I do
not understand what you're saying about the "Late" logic.
------------------
There is no calculation in the IIF Statement as to LATE. My logic
states...
"If a ShipDate is NOT "Early", and a ShipDate is NOT "On Time"...
then it must be "Late"
That's the "fallout" (no logic satisfied) of the IIF statement.

Try adjusting your "Early" and/or "OnTime" logic to cause the IFF
to properly fallout to "Late"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Al,
If I want to change my criteria of Late (Late = past due date and + 2
days from due date) how do i write that? I tried to modify and it
does'nt work.......
Here's the original code:
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))
Thanks again.
John


John,
I just noticed a mistype in my last post...
that will yield a count of Early in that group.
Should have read...
that will yield a count of "On Time" in that group.

Glad you got going OK...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

Thanks again - it works. Thanks so much for your help!

John,
The totals for each group should be done on the report footers,
not the query.

Place an unbound Text Control (ex. name = totEarly), in whatever
Group Footer section you want totals for.
Make the ControlSource of that text control...
= Sum(IIf([Status]="On Time",1,0))
that will yield a count of Early in that group.

Repeat that process with another unbound text control (ex. name =
totAll), with a ControlSource of...
= Sum(*)
that will yield a count of all records in that group.

If you still have problems, I need you to explain exactly what
you did, where you did it, and the code involved.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

I didn't work with the part where =Sum(IIf([Status]="On
Time",1,0)). It shows as a text when you preview the report. Same
thing with the =Count(*). Sorry I'm a newbie. I probably
misunderstood some of the details.
Thanks again and I will try it again.
John

THANK YOU VERY MUCH.
I will try it tomorrow morning- I appreciate it so much!!!
John

John,
You could apply my calculation and bind the value to a field
name like ShipStatus.
In your query design grid...
ShipStatus :
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Place the "bound" field ShipStatus on your report.
In any legitimate Footer, this would yield the Early count for
whatever Group.
=Sum(IIf([Status]="On Time",1,0))
Use that for each ShipStatus value.

Now, in each group, =Count(*) would yield the total count of
all records.
So... given that you know how many records there are, and the
count of each ShipStatus type, you can now calculate the
percentages of each ShipStatus.
Which (I'll bet a nickel) is probably what you're really
looking for after all...

Given what I know about this report, I would consider
breaking out the Status values... each in it's own column.
Early
Early
Late
OnTime
On time
Early
Totals 3 2 1

When/if you break this report by month or week, this layout
has better visual impact than just a 1column dump. You might
notice a pattern of Lates early in each week, or certain times
of the month... yadayada. Just a suggestion.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


Is there any way to summarize the total of Early, On Time and
Late on the query or report?
Thanks again!
John


WOW.....Thanks for the quick response and it works. I was
amazed!


John,
=
IIf([ShipDate]<=DateAdd("d",-3,[DueDate]),"Early",IIf([ShipDate]>=DateAdd("d",-2,[DueDate])
And [ShipDate]<=[DueDate],"On Time","Late"))

Please check my syntax for "finger checks", but that should
do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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


message
I'm trying to create a query for "On Time Delivery". I have
query fields of PO, Date Received, Due Date and Date
Shipped. I'd like to calculate EARLY (shipped 3 days early
from the due date), On Time (Shipped on Due Date or 2 days
early) and LATE (Shipped past Due Date) and on a business
days only (excluding Saturday and Sunday). These are all
coming from 3 different tables. I would appreciate any
ideas.

Thanks,

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top