944,035 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
May 15th, 2007
0

Please Help!

Expand Post »
I'm new with VB and I need to write a code that will calculate days starting from a start date (x), adding (y) days per month till the present date (z), subtracting given days (i) and finally giving remain days (j). Can anyone please given some examples.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mevanga is offline Offline
15 posts
since May 2007
May 15th, 2007
0

Re: Please Help!

Is this a school project ?

If so how far have you got ?
Reputation Points: 22
Solved Threads: 19
Posting Whiz
DenisOxon is offline Offline
345 posts
since Jan 2007
May 16th, 2007
0

Re: Please Help!

Click to Expand / Collapse  Quote originally posted by mevanga ...
I'm new with VB and I need to write a code that will calculate days starting from a start date (x), adding (y) days per month till the present date (z), subtracting given days (i) and finally giving remain days (j). Can anyone please given some examples.
u can use dateadd() and datediff() functions to manipulate date data type
above funtions are add two date and subtract one date from other date
but here datediff function does not give proper ansr.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
wavalker is offline Offline
11 posts
since Apr 2007
May 16th, 2007
0

Re: Please Help!

Click to Expand / Collapse  Quote originally posted by DenisOxon ...
Is this a school project ?

If so how far have you got ?
This is not a school project. I've designed a Data Base using MS ACCESS for my work and I need to create something that will calculate more or less the exact leave credit days of each person at work. That is why I want to use VB for that purpose. Please help me with any suggestion or examples that I can use. By the way, I' new with the VB. Please help me.

my email is snipped.

Thanx
Last edited by WaltP; May 17th, 2007 at 1:40 pm. Reason: Do not post emails on the board. Spammers love that!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mevanga is offline Offline
15 posts
since May 2007
May 17th, 2007
0

Re: Please Help!

My apologies - the post sounded like a school project. Where are the dates and day coming from, fileds, forms, etc? What are you going to do with result, display or store in a field ?

I'll try and suggest some code this evening.
Last edited by DenisOxon; May 17th, 2007 at 3:49 am.
Reputation Points: 22
Solved Threads: 19
Posting Whiz
DenisOxon is offline Offline
345 posts
since Jan 2007
May 17th, 2007
0

Re: Please Help!

Click to Expand / Collapse  Quote originally posted by DenisOxon ...
My apologies - the post sounded like a school project. Where are the dates and day coming from, fileds, forms, etc? What are you going to do with result, display or store in a field ?

I'll try and suggest some code this evening.

The dates and day are coming from :

1. Starting Date(x) : The date when the member started working,
2. Adding days per month(y) : Are days that are leave days added per month to each member,
3. Present Date(z) : Is the present date,
4. Given Days(i) : Are days that the member take when going on leave ,
5. Remain Days(j) : Are days that the member will have left after taking a leave.

The result I want to store and desplay in field that will deplay the total leave credit days a member has on the form that will deplay his/her personal details.

Thanx again.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mevanga is offline Offline
15 posts
since May 2007
May 17th, 2007
0

Re: Please Help!

Click to Expand / Collapse  Quote originally posted by mevanga ...
The dates and day are coming from :

1. Starting Date(x) : The date when the member started working,
2. Adding days per month(y) : Are days that are leave days added per month to each member,
This you can easily calculate from the start date to the current date. I assume you can handle this one. Look at the months for your calculations.


Click to Expand / Collapse  Quote originally posted by mevanga ...
3. Present Date(z) : Is the present date,
Yes, the function Date() will return the present date

Click to Expand / Collapse  Quote originally posted by mevanga ...
4. Given Days(i) : Are days that the member take when going on leave ,
Is this a value types in, read from the DB? Either way, it gets specified somehow.

Click to Expand / Collapse  Quote originally posted by mevanga ...
5. Remain Days(j) : Are days that the member will have left after taking a leave.
Now subtract the value in #4 from the value in #2

Click to Expand / Collapse  Quote originally posted by mevanga ...
The result I want to store and desplay in field that will deplay the total leave credit days a member has on the form that will deplay his/her personal details.
From the above you have:
Total leave days accumulated
Leave days taken
Leave days left

I'd recommend storing only leave days taken. The other two can easily be calculated when you need the values.
Moderator
Reputation Points: 3278
Solved Threads: 894
Posting Sage
WaltP is offline Offline
7,747 posts
since May 2006
May 17th, 2007
0

Re: Please Help!

To calculate till present date I got the picture, now my problem is that I want it update itself every month when the adding days per month are added.

Can you please give the example in codes. PLEASE.

Thanx
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mevanga is offline Offline
15 posts
since May 2007
May 17th, 2007
0

Re: Please Help!

Please Read This

I'm having to decipher what you are asking, which means I dont understand the question fully. Please explain exactly the scenario so we are clear -- after you read the above link.
Moderator
Reputation Points: 3278
Solved Threads: 894
Posting Sage
WaltP is offline Offline
7,747 posts
since May 2006
May 17th, 2007
0

Re: Please Help!

What I've meant was that the previous reply to my questions was understood and although I haven't test I got the picture. Now what I'm asking is that after I created that code how will I make it to update itself(adding days per month (y)) that will give the exact Leave Days Left of a member, that will be desplayed in the field that will show the total leave days of the member after all the calculations. Atually how will I loop this problem. If my explanation is not clear, please notify me sothat I try to explain from the start.

Please bear with me as I'm new in using the virtual basics.

Thanx.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mevanga is offline Offline
15 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: use vb in network application
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Archive MSaccess data into a different Access DB





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC