Calendar and time sheet

J

Jeff Conrad

in message:
Keith Wilby would rather spend his time showing how two-faced he is.

Keith answers a LOT of questions in the Security newsgroup Steve.
Do not ever forget that.
 
D

Douglas J. Steele

You can't be serious, Steve! Sure, it may be a little more work setting up
the data input, but by having properly normalized tables, then you have the
data such that you can do any analysis you require. Queries and reports
become easy, so in the unlikely event that it did cost more to design the
input forms, you'd more than make it up on the savings in the reporting
area.

A denormalized table is so inflexible for standard lookups. What if you need
to know the value for Sample1 for the 2nd Tuesday of the month. What's the
SQL for that? In a properly normalized table, the Where clause would include

Where Description = 'Sample 1' AND MyDate = GetDate(2005, 12, vbTuesday, 2)

where GetDate is:

Function GetDate (WhatYear As Long, _
WhatMonth As Long, _
WhatWeekDay As Long, _
WhatWeekDayOfMonth As Long) As Date

Dim dtmFirstOfMonth As Date

dtmFirstOfMonth = _
DateSerial(WhatYear, WhatMonth, 1)

GetDate = DateAdd("w", _
(WhatWeekDayOfMonth - 1) * 7, _
DateAdd("d", _
(WhatWeekDay - _
Weekday(dtmFirstOfMonth) + 7) Mod 7, _
dtmFirstOfMonth) _
)

End Function

In case the arguments aren't obvious, WhatYear is the year for the date,
WhatMonth is the number of the month (January = 1, February = 2 and so on to
December = 12), WhatWeekDay is the number of the weekday (Sunday = 1, Monday
= 2 and so on to Saturday = 7. Note that these are the same values as
vbSunday, vbMonday, …, vbSaturday) and WhatWeekdayOfMonth is the order
number of the weekday for the month (1 = first occurrence of that weekday in
the month, 2 = second occurrence of that weekday in the month, etc.).
 
P

PC Datasheet

You wouldn't build a search form that has the user enter "the second Tuesday
of the month". You would pop-up a calendar and have him select the date. By
selecting the date, the user has now selected the Year, Month and Day.
November 8 was the second Tuesday of November. To get the value for Sample1
for Nonember 8, 2005, all you need is a query to find the record for Sample1
for the Year 2005, the month of November and Day8. You don't need more
additional code stacked on alot of code to populate a bunch of text boxes.


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

Over 1050 users have come from the newsgroups trusting me and requesting
help.
My fees are very reasonable.
 
D

Duane Hookom

Steve,
One of the greatest assets of a good programmer is the ability to identify
patterns. Can you see the pattern below?

News Groups
====================================
A question is posted: no advertising: No conflict
A question is posted: no advertising: No conflict
A question is posted: advertising: Lots of conflict
A question is posted: no advertising: No conflict
A question is posted: no advertising: No conflict
A question is posted: no advertising: No conflict
A question is posted: advertising: Lots of conflict

Can you find the conflicts? If you look at actual threads with conflicts,
can you find the ONE common initial element of each thread?

Do you ever see Arno R or myself or any others creating conflict without an
advertising post first?

Think about it...
 
R

Randy Harris

PC Datasheet said:
This is totally untrue!!


And you were planning to say nice things about those guys before all of this
started, you just hadn't gotten around to it, right?

Hint for Steve: s-a-r-c-a-s-m
 
F

Fehn

Thanks Duane! That is what I want, I want it to be updatable... I will try
other methods that other MVP's suggested.... Thanks again.....
 
D

Duane Hookom

Steve,
"a bunch of code" "jack up the cost"? I had the form and code created in a
matter of minutes (apparently I work faster than you). I then
provided/donated most of the solution free in this public news group (and an
earlier thread).

The tables were normalized and the data entry met the requirements. I have
done this a few times and it becomes quick and easy. My customers don't have
to pay extra later on when they need to query for all Tuesdays or sum the
values between 5/12 and 5/25. I would NEVER provide a solution to a client
that would work as you proposed.

When I read your post with the "spreadsheet" looking table structure, I held
back from criticizing your solution. Although I vehemently criticize your
advertising, I was too much of a gentleman to criticize your lack of
understanding of application development.

I called you an "idiot" once when you took a friend's statement totally out
of context and then immediately apologized. I have often criticized actions
and have tried to never refer to anyone as "DUMB", "Nitwit", or other
derogatory expressions (although I often think it).

You might get more work if you didn't display a lack of understanding of
news groups and programming.
 
D

Duane Hookom

Steve,
And how do you sum the values from November 1 to November 15?
My solution would use something simple like:
SELECT Sum(theValueField) as TheSum
FROM tblWhatever
WHERE theDateField BETWEEN #11/1/2005# AND #11/15/2005#

Or all the Wednesdays
SELECT Sum(theValueField) as TheSum
FROM tblWhatever
WHERE WeekDay(theDateField)=4

Actually most of my clients could easily write this query if they needed it.
This would be especially easy if they used my free query by form applet
available on the web.

Could your table structure easily answer either of the above queries? Could
a client with basic Access knowledge perform this with your structure? Or,
would your client have to call you receive another invoice? Would your table
structure provide any additional functionality or flexibility other than
make a form easier to create early in a project?
 
E

Ed Warren

My first thought was to take my non-MVP ideas and stay home, but what fun
would that be?

In Duane's solution: you may want to consider what happens when you (or
others) manage to enter more than one case of Sample2 on the same date.

-----------------------------------data structure (Duane)
SampleID Autonumber primary key
SampleTypeID link to table containing descriptions
SampleDate
SampleValue

------------------------------------------(maybe not if you strictly use
Duane's input screen for all data input) Nothing from a data structure
perspective prevents this.
This could easily be fixed by setting a unique index to the
SampleTypeID/date pair.

SampleID SampleTypeID SampleDate SampleValue
1 2 12/1/2005 3
2 2 12/1/2005 6
3 2 12/1/2005 7
----------------------------------------------

Now what do you want to see?
Case A
Description 12/1/2005
Sample2 3
Sample2 6
Sample2 7
---------------------------
Case B
Description 12/1/2005
Sample2 16 (total)

-------------------------
Case C
Description 12/1/2005
Sample2 3 (count)
--------------------------
Case D
Description 12/1/2005
Sample2 5.3 (Avg)

If Case B,C, or D then you will want to use a pivot table/crosstab query and
do the data updates via a simple form.
If you really want only one case per day and really need to show it as a
matrix as discussed then, with the limit above you will probably want to
follow Duane's suggestion, because you will want to query the data for some
useful informtion in the future.

Ed Warren.
 
D

Douglas J. Steele

So show me how you'd generate SQL you'd use to retrieve the value from your
denormalized table in the circumstance you just suggested, Steve. With a
normalized table, I'd need a single parameter query, and I'd be done.

You're right: my example wasn't that realistic in terms of being invoked
through a prompt (although there are certainly times when you would want to
determine a date programmatically in terms of nth weekday of the month).

However, Duane's example of "Give me the sum of all of the samples from
November 1st, 2005 to November 15th, 2005" (or, more generically, "Give me
the sum of all of the samples between a day I'm going to select using a
calendar control and another day I'm going to select using a second calendar
control") certainly is realistic. How would you handle that with your
denormalized table? Again, it's a single parameter query with a properly
normalized table.
 
S

StopThisAdvertising

PC said:
This is totally untrue!!

Keith Wilby would rather spend his time showing
how two-faced he is.
How exactly do you do that? Can you explain it? Thought not. Idiot.
 
P

PC Datasheet

Duane,

One of the prime signs of a dimwit is a post like the one you just made. You
have sunk to the lowest depths with John Marshall.

This is just evidence that you don't give a damn about the newsgroups, about
polluting the newsgroups with worthless garbage and wasting a large volume
of bandwidth.


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

Over 1050 users have come from the newsgroups trusting me and requesting
help.
My fees are very reasonable.
 
P

PC Datasheet

So your "friend" is Arno R!


Duane Hookom said:
Steve,
"a bunch of code" "jack up the cost"? I had the form and code created in a
matter of minutes (apparently I work faster than you). I then
provided/donated most of the solution free in this public news group (and
an earlier thread).

The tables were normalized and the data entry met the requirements. I have
done this a few times and it becomes quick and easy. My customers don't
have to pay extra later on when they need to query for all Tuesdays or sum
the values between 5/12 and 5/25. I would NEVER provide a solution to a
client that would work as you proposed.

When I read your post with the "spreadsheet" looking table structure, I
held back from criticizing your solution. Although I vehemently criticize
your advertising, I was too much of a gentleman to criticize your lack of
understanding of application development.

I called you an "idiot" once when you took a friend's statement totally
out of context and then immediately apologized. I have often criticized
actions and have tried to never refer to anyone as "DUMB", "Nitwit", or
other derogatory expressions (although I often think it).

You might get more work if you didn't display a lack of understanding of
news groups and programming.
 
F

fredg

Duane,

You continue to demonstrate that you are not even in the league with class
acts like Allen Browne, Ken Snell, Pieter Linden, Albert Kallal, Fred G,
Graham Mandello, Chuck Grimsby, MG Foster, and others.

Steve,
You have gone too far.
To partially quote Joseph Welch --
"... Have you no sense of decency ...?"
Your first reply to the OP was a direct solicitation of business,
without even an attempt to give a workable answer to his question.
This went far beyond your signature solicitation and was totally
uncalled for.

You then assumed my non-participation in calling you to task was some
sort of approval of your behavior. Quite the contrary. I didn't wish
to take up my time, nor the time of others, in what I perceive is a
futile attempt to get you to observe the common courtesies of
participation in an international newsgroup dedicated to 'free'
technical help.

You then went and mentioned my name in an attempt to separate the
posters who have actively called you to task for these solicitations
from those of us, MVP's and others, who for whatever reason chose not
to participate. I can keep quiet no longer.

Steve, after following these many threads in the various Access
newsgroups over the past months, I can surely state that there is more
class in the fingertips of Arno, Duane, John, Randy, Keith and Jeff,
(and I'm sure lot's others who have not been actively participating
in this 'discussion'), than you have in your whole body.

You see, it's not just a matter of what you 'can or can't do,' it's a
matter of what you 'should or should not do' that separates 'Class
Acts' from the rest.

In a later post in this thread your wrote:
"There's an old saying, "birds of a feather flock together".

I agree. I'm very happy to be associated with Arno, Duane, et alia.
Believe me, it's much better to be an eagle than a turkey!
 
D

Duane Hookom

Again you ignore the questions and facts that provide proof that you are
wrong and ask a tangential question to attempt to get logic off track.

I don't personally know Arno R. Don't ask me about Arno R. I was referring
to my friend and acquaintence Ken Snell. Remember the thread where you
accused Ken of advertising in public news groups? Here is the message that I
was referring to:
================================================
Steve,
You are a complete idiot! I just searched for the thread you quoted from Ken
Snell. The thread subject was "i need a pro". How can you even suggest that
what you do compares with Ken's reply? Do you have no common sense? Can't
you tell the difference between a OP who comes looking for free advice and
someone who comes expecting to pay?

The full text of the message Ken replied to:
"hi all, is there a site that has a list of pros that will actually set
up microsoft access for me. i need it set up for my small business
and it is far too complicated for me. i live in the northern kentucky
area about 50 miles south of cincinnati ohio. thanks for any replies
an have a nice holiday weekend"

In another reply in the same thread, the OP stated:
"..and then they could have an idea as to what they should charge me. "

Here's a little test. Rate the following on the appropriateness offering to
provide paid contracting services:

Subject 1: i need a pro
Subject 2: Multidimensional Forms/Tables
================================================
 
P

PC Datasheet

Here's a rhetorical question for you ---

"Why are you so stupid?"

Thanks for providing the link where I got that!!!!!


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

Over 1050 users have come from the newsgroups trusting me and requesting
help.
My fees are very reasonable.
 

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