Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2007
Posts: 15
Reputation: mevanga is an unknown quantity at this point 
Solved Threads: 0
mevanga mevanga is offline Offline
Newbie Poster

Please Help!

 
0
  #1
May 15th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 319
Reputation: DenisOxon is an unknown quantity at this point 
Solved Threads: 15
DenisOxon's Avatar
DenisOxon DenisOxon is offline Offline
Posting Whiz

Re: Please Help!

 
0
  #2
May 15th, 2007
Is this a school project ?

If so how far have you got ?
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 11
Reputation: wavalker is an unknown quantity at this point 
Solved Threads: 1
wavalker wavalker is offline Offline
Newbie Poster

Re: Please Help!

 
0
  #3
May 16th, 2007
Originally Posted by mevanga View 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.
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.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 15
Reputation: mevanga is an unknown quantity at this point 
Solved Threads: 0
mevanga mevanga is offline Offline
Newbie Poster

Re: Please Help!

 
0
  #4
May 16th, 2007
Originally Posted by DenisOxon View Post
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!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 319
Reputation: DenisOxon is an unknown quantity at this point 
Solved Threads: 15
DenisOxon's Avatar
DenisOxon DenisOxon is offline Offline
Posting Whiz

Re: Please Help!

 
0
  #5
May 17th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 15
Reputation: mevanga is an unknown quantity at this point 
Solved Threads: 0
mevanga mevanga is offline Offline
Newbie Poster

Re: Please Help!

 
0
  #6
May 17th, 2007
Originally Posted by DenisOxon View Post
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.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Please Help!

 
0
  #7
May 17th, 2007
Originally Posted by mevanga View Post
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.


Originally Posted by mevanga View Post
3. Present Date(z) : Is the present date,
Yes, the function Date() will return the present date

Originally Posted by mevanga View Post
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.

Originally Posted by mevanga View Post
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

Originally Posted by mevanga View Post
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.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 15
Reputation: mevanga is an unknown quantity at this point 
Solved Threads: 0
mevanga mevanga is offline Offline
Newbie Poster

Re: Please Help!

 
0
  #8
May 17th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Please Help!

 
0
  #9
May 17th, 2007
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.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 15
Reputation: mevanga is an unknown quantity at this point 
Solved Threads: 0
mevanga mevanga is offline Offline
Newbie Poster

Re: Please Help!

 
0
  #10
May 17th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC