# relate column

Hi,

Split schedules are two kinds of schedules.
-Let's say on Monday and Tuesday you start at 9:00 and you go home at 18:00
then on Wednesday, Thursday, and Saturday you start at 7:00 and you go home at 16:00

I have an access database with 7 columns for Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday
i.e.

Mon  Tue  Wed  Thu  Fri  Sat  Sun
Y       Y      Y       Y          Y                        -Y signifies you have a schedule for that particular day
____________________________________________________________________________________________

question,

I have database records with couple of situations, Some have only one instance of 'Y' this means he only comes in one day of the week. We don't want that. How do we squeeze that to search for a record that has four 'Y' ?
i.e.
ID Mon  Tue  Wed  Thu  Fri  Sat  Sun   Related
01   Y                                                   1                <-------the new column related tell's that it is related to another schedule
02                          Y      Y     Y    Y       1                <-------the new column related tell's that it is related to another schedule

A complete schedules are 5 working days.
We can have them working on Saturday and Sunday.
we need to search for these types of schedules and related them to one another.
relate uncomplete schedules (we found 3 working days, find 2 working days and see if they are a match)

I'm able to pull up those schedules that are less than 5.

SQL = "SELECT Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday FROM forecastsched " & _
"WHERE ( " & _
" Iif(Monday='Y',1,0) + Iif(Tuesday='Y',1,0) + Iif(Wednesday='Y',1,0) + " & _
" Iif(Thursday='Y',1,0) + Iif(Friday='Y',1,0) + Iif(Saturday='Y',1,0)  + Iif(Sunday='Y',1,0) " & _
" ) < 5;"

Thanks,
Lynnton
LVL 1
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Hi again Lynnton

Can I have the points here as well? ;)
0
Author Commented:
muzzy2003,

I wasn't able finish what you've started so I'm asking for other people's opinion.

Thanks,
Lynnton
0
Commented:
Sorry, don't quite understand. I thought you said the solution I posted at:

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_21218435.html

was working perfectly? If you are still having problems with it, please post them so I can sort them out for you. I don't like providing partially working solutions. :)
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.