Hello All,

How can achieve the following:
A = 2
B = 3
C = 25
D = 3
X = 10

I would like to obtain X = 0 by decreasing each A B C D (keeping this
priority). In this example only A B & C will be affected

Thanks for your help

Re: Need help for writing a vbscript from the Gurus by McKirahan

McKirahan
Mon Jan 03 08:16:27 CST 2005

"slimo" <slimobeny@hotmail.com> wrote in message
news:81c3f6f7.0501030554.6eb4f0c9@posting.google.com...
> Hello All,
>
> How can achieve the following:
> A = 2
> B = 3
> C = 25
> D = 3
> X = 10
>
> I would like to obtain X = 0 by decreasing each A B C D (keeping this
> priority). In this example only A B & C will be affected
>
> Thanks for your help

What?

X = (A + B + C) / D?




Re: Need help for writing a vbscript from the Gurus by Slimo

Slimo
Mon Jan 03 08:47:52 CST 2005

Hi,

To obtain X = 0, A must be decreased by 2, B decreased by 3 and C decreased
by 5. At the end I must obtain
A=0, B=0 and C=20
How can do it programatically? I need some tip

Thanks

"McKirahan" <News@McKirahan.com> wrote in message
news:%scCd.321925$HA.10009@attbi_s01...
> "slimo" <slimobeny@hotmail.com> wrote in message
> news:81c3f6f7.0501030554.6eb4f0c9@posting.google.com...
> > Hello All,
> >
> > How can achieve the following:
> > A = 2
> > B = 3
> > C = 25
> > D = 3
> > X = 10
> >
> > I would like to obtain X = 0 by decreasing each A B C D (keeping this
> > priority). In this example only A B & C will be affected
> >
> > Thanks for your help
>
> What?
>
> X = (A + B + C) / D?
>
>
>



Re: Need help for writing a vbscript from the Gurus by sali

sali
Mon Jan 03 08:55:14 CST 2005

"Slimo" <slimobeny@hotmail.com> wrote in message
news:41d95b16$0$2698$ba620e4c@news.skynet.be...
> Hi,
>
> To obtain X = 0, A must be decreased by 2, B decreased by 3 and C
decreased
> by 5. At the end I must obtain
> A=0, B=0 and C=20
> How can do it programatically? I need some tip

you need to present *relation* between a,b,c,d and x!
without that, there is no help [nor hope] for your question.



> "McKirahan" <News@McKirahan.com> wrote in message
> news:%scCd.321925$HA.10009@attbi_s01...
> > "slimo" <slimobeny@hotmail.com> wrote in message
> > news:81c3f6f7.0501030554.6eb4f0c9@posting.google.com...
> > > Hello All,
> > >
> > > How can achieve the following:
> > > A = 2
> > > B = 3
> > > C = 25
> > > D = 3
> > > X = 10
> > >
> > > I would like to obtain X = 0 by decreasing each A B C D (keeping this
> > > priority). In this example only A B & C will be affected
> > >
> > > Thanks for your help
> >
> > What?
> >
> > X = (A + B + C) / D?
> >
> >
> >
>
>



Re: Need help for writing a vbscript from the Gurus by Slimo

Slimo
Mon Jan 03 09:09:51 CST 2005

Hi

I have one table that contains 5 fields: Name, PrevYearHol, PublicHoliday,
PaidHoliday and Overtime.
One user request to take 10 days vacation, if the request is approved then I
need to decrease his holiday for the year.
So I need to check first if PrevYearHol is greater than 0, if greater then I
decrease the PrevYearHol and so on



"sali" <gabor.salai@tel.net.ba> wrote in message
news:OSe0$Qa8EHA.2876@TK2MSFTNGP12.phx.gbl...
> "Slimo" <slimobeny@hotmail.com> wrote in message
> news:41d95b16$0$2698$ba620e4c@news.skynet.be...
> > Hi,
> >
> > To obtain X = 0, A must be decreased by 2, B decreased by 3 and C
> decreased
> > by 5. At the end I must obtain
> > A=0, B=0 and C=20
> > How can do it programatically? I need some tip
>
> you need to present *relation* between a,b,c,d and x!
> without that, there is no help [nor hope] for your question.
>
>
>
> > "McKirahan" <News@McKirahan.com> wrote in message
> > news:%scCd.321925$HA.10009@attbi_s01...
> > > "slimo" <slimobeny@hotmail.com> wrote in message
> > > news:81c3f6f7.0501030554.6eb4f0c9@posting.google.com...
> > > > Hello All,
> > > >
> > > > How can achieve the following:
> > > > A = 2
> > > > B = 3
> > > > C = 25
> > > > D = 3
> > > > X = 10
> > > >
> > > > I would like to obtain X = 0 by decreasing each A B C D (keeping
this
> > > > priority). In this example only A B & C will be affected
> > > >
> > > > Thanks for your help
> > >
> > > What?
> > >
> > > X = (A + B + C) / D?
> > >
> > >
> > >
> >
> >
>
>



Re: Need help for writing a vbscript from the Gurus by McKirahan

McKirahan
Mon Jan 03 09:33:37 CST 2005

"Slimo" <slimobeny@hotmail.com> wrote in message
news:41d96040$0$2584$ba620e4c@news.skynet.be...
> Hi
>
> I have one table that contains 5 fields: Name, PrevYearHol, PublicHoliday,
> PaidHoliday and Overtime.
> One user request to take 10 days vacation, if the request is approved then
I
> need to decrease his holiday for the year.
> So I need to check first if PrevYearHol is greater than 0, if greater then
I
> decrease the PrevYearHol and so on


Well, your problem statement (requirements) are getting a little better.

If you want concise assistance then please take the time to phrase a concise
question / problem.

What does vacation have to do with holidays?

Start over and associate A, B, C, D, and X with something; perhaps,
PrevYearHol, PublicHoliday,
PaidHoliday, Overtime, and {Balance}. Additionally, examples would help.




Re: Need help for writing a vbscript from the Gurus by sali

sali
Mon Jan 03 09:57:10 CST 2005

"Slimo" <slimobeny@hotmail.com> wrote in message
news:41d96040$0$2584$ba620e4c@news.skynet.be...
> Hi
>
> I have one table that contains 5 fields: Name, PrevYearHol, PublicHoliday,
> PaidHoliday and Overtime.
> One user request to take 10 days vacation, if the request is approved then
I
> need to decrease his holiday for the year.
> So I need to check first if PrevYearHol is greater than 0, if greater then
I
> decrease the PrevYearHol and so on
>

well, try arrays:
dim days(100,5)
'100 stays for 100 employees, each one per record
'5 stays for (1)=name, (2)=prev, (3)=public, (4)=paid, (5)=overtime

e=emp 'some employe record
x=x0 'days to revoke
for d=2 to 5
dd=days(e,d)
if dd>=x then
days(e,d)=dd-x
x=-1 'ok flagg
exit for 'end of job
else
x=x-dd
days(e,d)=0
end if
next




>
> "sali" <gabor.salai@tel.net.ba> wrote in message
> news:OSe0$Qa8EHA.2876@TK2MSFTNGP12.phx.gbl...
> > "Slimo" <slimobeny@hotmail.com> wrote in message
> > news:41d95b16$0$2698$ba620e4c@news.skynet.be...
> > > Hi,
> > >
> > > To obtain X = 0, A must be decreased by 2, B decreased by 3 and C
> > decreased
> > > by 5. At the end I must obtain
> > > A=0, B=0 and C=20
> > > How can do it programatically? I need some tip
> >
> > you need to present *relation* between a,b,c,d and x!
> > without that, there is no help [nor hope] for your question.
> >
> >
> >
> > > "McKirahan" <News@McKirahan.com> wrote in message
> > > news:%scCd.321925$HA.10009@attbi_s01...
> > > > "slimo" <slimobeny@hotmail.com> wrote in message
> > > > news:81c3f6f7.0501030554.6eb4f0c9@posting.google.com...
> > > > > Hello All,
> > > > >
> > > > > How can achieve the following:
> > > > > A = 2
> > > > > B = 3
> > > > > C = 25
> > > > > D = 3
> > > > > X = 10
> > > > >
> > > > > I would like to obtain X = 0 by decreasing each A B C D (keeping
> this
> > > > > priority). In this example only A B & C will be affected
> > > > >
> > > > > Thanks for your help
> > > >
> > > > What?
> > > >
> > > > X = (A + B + C) / D?
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: Need help for writing a vbscript from the Gurus by Slimo

Slimo
Mon Jan 03 10:19:09 CST 2005

Thanks,

I will try it

"sali" <gabor.salai@tel.net.ba> wrote in message
news:OfRpJ0a8EHA.2900@TK2MSFTNGP09.phx.gbl...
> "Slimo" <slimobeny@hotmail.com> wrote in message
> news:41d96040$0$2584$ba620e4c@news.skynet.be...
> > Hi
> >
> > I have one table that contains 5 fields: Name, PrevYearHol,
PublicHoliday,
> > PaidHoliday and Overtime.
> > One user request to take 10 days vacation, if the request is approved
then
> I
> > need to decrease his holiday for the year.
> > So I need to check first if PrevYearHol is greater than 0, if greater
then
> I
> > decrease the PrevYearHol and so on
> >
>
> well, try arrays:
> dim days(100,5)
> '100 stays for 100 employees, each one per record
> '5 stays for (1)=name, (2)=prev, (3)=public, (4)=paid, (5)=overtime
>
> e=emp 'some employe record
> x=x0 'days to revoke
> for d=2 to 5
> dd=days(e,d)
> if dd>=x then
> days(e,d)=dd-x
> x=-1 'ok flagg
> exit for 'end of job
> else
> x=x-dd
> days(e,d)=0
> end if
> next
>
>
>
>
> >
> > "sali" <gabor.salai@tel.net.ba> wrote in message
> > news:OSe0$Qa8EHA.2876@TK2MSFTNGP12.phx.gbl...
> > > "Slimo" <slimobeny@hotmail.com> wrote in message
> > > news:41d95b16$0$2698$ba620e4c@news.skynet.be...
> > > > Hi,
> > > >
> > > > To obtain X = 0, A must be decreased by 2, B decreased by 3 and C
> > > decreased
> > > > by 5. At the end I must obtain
> > > > A=0, B=0 and C=20
> > > > How can do it programatically? I need some tip
> > >
> > > you need to present *relation* between a,b,c,d and x!
> > > without that, there is no help [nor hope] for your question.
> > >
> > >
> > >
> > > > "McKirahan" <News@McKirahan.com> wrote in message
> > > > news:%scCd.321925$HA.10009@attbi_s01...
> > > > > "slimo" <slimobeny@hotmail.com> wrote in message
> > > > > news:81c3f6f7.0501030554.6eb4f0c9@posting.google.com...
> > > > > > Hello All,
> > > > > >
> > > > > > How can achieve the following:
> > > > > > A = 2
> > > > > > B = 3
> > > > > > C = 25
> > > > > > D = 3
> > > > > > X = 10
> > > > > >
> > > > > > I would like to obtain X = 0 by decreasing each A B C D (keeping
> > this
> > > > > > priority). In this example only A B & C will be affected
> > > > > >
> > > > > > Thanks for your help
> > > > >
> > > > > What?
> > > > >
> > > > > X = (A + B + C) / D?
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: Need help for writing a vbscript from the Gurus by ews

ews
Thu Jan 06 18:46:52 CST 2005

slimo wrote:
> Hello All,
>
> How can achieve the following:
> A = 2
> B = 3
> C = 25
> D = 3
> X = 10
>
> I would like to obtain X = 0 by decreasing each A B C D (keeping this
> priority). In this example only A B & C will be affected
>
> Thanks for your help

do yer own homework.