A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to normalize this table



 
 
Thread Tools Display Modes
  #1  
Old December 24th, 2007, 08:46 PM posted to microsoft.public.access.tablesdbdesign
CoachBarkerOJPW
external usenet poster
 
Posts: 72
Default How to normalize this table

I have created asmall application in vb.net. Not relevent here I know , but
the table structure of one of the tables is. Right now I have three tables,
tblPatient, tblGlucose and tblExercise. I need to come up with a better
solution for the exercise table. Right now I just update the table for
everyday. Right now the records are kept based on the WeekBeginning field, so
I want 7 records before I start a new row.
The weekdays in the table are to give the user of the application a visual
sense in the form of when they have exercised.

Any suggestions?

tblExercise
ExerciseLogID
PatientID
WeekBeginning
DateEntered
ExerciseYes
ExerciseNo
MinutesExercised
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Walk
Jog
Run
Swim
Bicycle
WhyNot
WeeksTotal

--
Thank you very much
CoachBarkerOJPW
  #2  
Old December 24th, 2007, 08:57 PM posted to microsoft.public.access.tablesdbdesign
Tom Lake[_2_]
external usenet poster
 
Posts: 96
Default How to normalize this table


"CoachBarkerOJPW" wrote in
message ...

I want 7 records before I start a new row.


There's one problem. Use a separate record for each day's readings rather
than
seven readings in one record. To normalize, think long rather than wide.

Tom Lake

  #3  
Old December 24th, 2007, 09:54 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default How to normalize this table

On Mon, 24 Dec 2007 12:46:00 -0800, CoachBarkerOJPW
wrote:

I have created asmall application in vb.net. Not relevent here I know , but
the table structure of one of the tables is. Right now I have three tables,
tblPatient, tblGlucose and tblExercise. I need to come up with a better
solution for the exercise table. Right now I just update the table for
everyday. Right now the records are kept based on the WeekBeginning field, so
I want 7 records before I start a new row.
The weekdays in the table are to give the user of the application a visual
sense in the form of when they have exercised.


Use one record per day, or - better - per exercise event (somebody might want
to exercise twice a day after all!). You can create a (non-editable) Crosstab
query for display purposes, but don't let that data display requirement drive
you into an improper table design.

John W. Vinson [MVP]
  #4  
Old December 24th, 2007, 10:50 PM posted to microsoft.public.access.tablesdbdesign
Tom Lake[_2_]
external usenet poster
 
Posts: 96
Default How to normalize this table

Use one record per day, or - better - per exercise event (somebody might
want
to exercise twice a day after all!).


Are you kidding?!? 8^)

Tom Lake

--
My doctor told me I have to get in shape.
I said, "Round is a shape, isn't it?"

  #5  
Old December 24th, 2007, 11:43 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default How to normalize this table

On Mon, 24 Dec 2007 17:50:59 -0500, "Tom Lake" wrote:

Use one record per day, or - better - per exercise event (somebody might
want
to exercise twice a day after all!).


Are you kidding?!? 8^)

Tom Lake


Well, I admit that I get most of my exercise stretching points and jumping to
conclusions!

John W. Vinson [MVP]
  #6  
Old December 25th, 2007, 01:19 AM posted to microsoft.public.access.tablesdbdesign
Tony Toews [MVP]
external usenet poster
 
Posts: 3,776
Default How to normalize this table

"Tom Lake" wrote:

Use one record per day, or - better - per exercise event (somebody might
want
to exercise twice a day after all!).


Are you kidding?!? 8^)


Sure one walk to the coffee shop, casino, bar for video lottery
terminal or drink(s), corner store for smokes, liquor store and back.
That's twice, right?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
  #7  
Old December 27th, 2007, 05:33 PM posted to microsoft.public.access.tablesdbdesign
Dale Fye
external usenet poster
 
Posts: 2,651
Default How to normalize this table

Going with John's suggestion, I'd probably do something like:

tblExercise:
ExerciseLogID
PatientID
DateEntered
ExerTypeID (FK to tblExerTypes)
Exer_Duration (long integer - minutes)
Comment (for ExerTypeName = None)

I like the idea of an Exercise types table because it allows you to add
exercise types at a later time without having to add a column to your table
structure.
tblExerTypes:
ExerTypeID (Long integer)
ExerTypeName (walk, jog, run, swim, bike, None)
ExerTypeSort (Integer - used to sort these values)

If you need the WeekStart, you can get it for any date using the expression:

WeekStart: [DateEntered] - Weekday([DateEntered]) + 1

HTH
Dale
--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"CoachBarkerOJPW" wrote:

I have created asmall application in vb.net. Not relevent here I know , but
the table structure of one of the tables is. Right now I have three tables,
tblPatient, tblGlucose and tblExercise. I need to come up with a better
solution for the exercise table. Right now I just update the table for
everyday. Right now the records are kept based on the WeekBeginning field, so
I want 7 records before I start a new row.
The weekdays in the table are to give the user of the application a visual
sense in the form of when they have exercised.

Any suggestions?

tblExercise
ExerciseLogID
PatientID
WeekBeginning
DateEntered
ExerciseYes
ExerciseNo
MinutesExercised
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Walk
Jog
Run
Swim
Bicycle
WhyNot
WeeksTotal

--
Thank you very much
CoachBarkerOJPW

 




Thread Tools
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 On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:35 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.