The general expression is "Rows are cheap, fields are expensive".
For the data you showed, it should be something like:
RDOGroup Type MOD
1 Rotating 0
1 Rotating 1
2 Rotating 1
2 Rotating 2
3 - 7 omitted
8 Fixed 1
8 Fixed 2
9 Fixed 0
9 Fixed 1
Jeff Conrad lists a number of good resources for database modelling athttp://
www.accessmvp.com/JConrad/accessjunkie/resources.html#Database...
--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)
In addition to everything else that's been said, the fact that you've
apparently got field names like MOD0, MOD1, MOD2,... MOD195 is likely
indicative of the fact that your table hasn't been properly normalized.
Newbie question. Receiving a syntax error in INSERT INTO statement. IfI
create the query in the QBE it works fine with the WHERE clause hard
coded
as follows;
INSERT INTO tbl_Available ( [Group] )
SELECT Rot.Group
FROM Rot
WHERE (((Rot.MOD173)=1));
Here is my code!
Dim strSQL As String
Dim intMod As Integer
intMod = CLng(Me.Text0) Mod 196
strSQL = "DELETE * FROM tbl_Available"
CurrentDb.Execute strSQL
strSQL = "INSERT INTO tbl_Available Group " _
& "SELECT Rot.Group FROM Rot " _
& "WHERE ROT.[MOD" & intMod & "] = 1 "
CurrentDb.Execute strSQL, dbFailOnError
Thanks in advance- Hide quoted text -
Thanks for your response Doug. I truly welcome any ideas you have.
Maybe you can give me some direction on how to make this project more
efficient.
I have one table, which is used strictly as a look up table of 49
different work schedules. There are 7 different types of schedules
with 7 variations of each schedule.
As a small example, the records in the table would be as follows;
RDOGroup Type MOD0 MOD1 MOD2 etc.... MOD195
1 Rotating 1 1
2 Rotating 1 1
3 - 7 omitted
8 Fixed 1 1
9 Fixed 1 1
The 1 in the MOD* field signifies the group which is off. I could
have used -1 and 0, but this is how the table was imported from
Paradox. I use the intMod = CLng(Me.Text0) Mod 196 function to
determine which group is off for that day. I am concatenating the
literal text MOD" & intMod so I know which column to query from this
table. Example: 05/01/2008 returns 173 which in turn = (MOD173).
I then INSERT INTO the (14 different groups) RDOCall table. The
groups in the RDOCall table are used for various Forms and Reports.
It actually works pretty slick and easy, but like I said, I open to
any ideas.
Short of the user having to know which RDO Group is off on a given
day, I don't know how I could normalize this table and still have all
the variations of schedules.
The big key is for the user to be able to enter a date in a textbox on
the Form, then click the A-List OR B-List (certain criteria apply) for
Overtime Button and a Form to add the overtime hours opens OR a Report
opens to show which employees are off, in order to call them in for
Overtime. Only those who are off on that date are populated into the
Form/Report.
There is flexibility in the fact that you have to select a tab for
which shift you are working. Select the Morning shift tab, then click
the A-List Report button to show who is off. Of course there are
preferences in the Employee table allowing the employee to not be
called for any overtime. A1, B1, A2, B2, A3, B3. Yes of No choices.
The same applies to adding hours for those who have been called in or
those who refused overtime.
Note: A-List is for those who are off on THEIR shift and wish to work
overtime. The B-List is for those who are on OTHER shifts wishing to
work overtime on your shift. This is all voluntary overtime. There
is a completely different set of rules for the Mandate List.
Thanks in advance.- Hide quoted text -
- Show quoted text -