Need Help! calculating date fields 
Author Message
 Need Help! calculating date fields

Hi,

I wondered if anyone could help.
I started using Ultradev and VBScipt about 7 days ago and have found the
learning curve quite steep, I seem to be getting to grips with UltraDev but
VBScript is another thing!

I'm trying to calculate the difference between two date fields in a form
i.e. StartDate / ReturnDate = Number of Days
then set this value to a Session Variable. I know I can use the DateDiff
function of VBScript but I'm not confident about how to code this.
If anyone could give me more of an idea on how and were to write this script
into the source code of the page I would be most grateful.

I have managed to get a basic version of the site up and running at
http://www.*-*-*.com/ :10168/login.asp it's lacking any design
and a lot of navigation as of yet but is working so far!! The Form I need to
calculate is on a page named DistressHire3.asp but you will need to logon to
get it to desplay properly.

Feel free to take a look around and let me know what you think, (You can
Logon as username: lee  Password: any)

I think I am going to need to buy a good book on VBScript any suggestions?

Many Thanks

Lee Beatty



Sat, 15 Nov 2003 02:40:27 GMT  
 Need Help! calculating date fields
While not the same as a book, you might want to download the VBScript
documentation from
http://msdn.microsoft.com/scripting/default.htm?/scripting/vbscript/d...

That will give you the same details on how to use DateDiff as
http://msdn.microsoft.com/scripting/default.htm?/scripting/vbscript/d...
tDateDiff.htm

To calculate the difference in days between 2 dates, you'd use:

DateDiff("d", StartDate, ReturnDate)

HTH

--
Doug Steele, Microsoft Access MVP
http://i.am/DougSteele/


Quote:
> Hi,

> I wondered if anyone could help.
> I started using Ultradev and VBScipt about 7 days ago and have found the
> learning curve quite steep, I seem to be getting to grips with UltraDev
but
> VBScript is another thing!

> I'm trying to calculate the difference between two date fields in a form
> i.e. StartDate / ReturnDate = Number of Days
> then set this value to a Session Variable. I know I can use the DateDiff
> function of VBScript but I'm not confident about how to code this.
> If anyone could give me more of an idea on how and were to write this
script
> into the source code of the page I would be most grateful.

> I have managed to get a basic version of the site up and running at
> http://www-uk-w2k-4.nildram.co.uk:10168/login.asp it's lacking any design
> and a lot of navigation as of yet but is working so far!! The Form I need
to
> calculate is on a page named DistressHire3.asp but you will need to logon
to
> get it to desplay properly.

> Feel free to take a look around and let me know what you think, (You can
> Logon as username: lee  Password: any)

> I think I am going to need to buy a good book on VBScript any suggestions?

> Many Thanks

> Lee Beatty



Sat, 15 Nov 2003 05:40:39 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Changing a Calculate field (Date) depending on Current date

2. HELP me calculate a date field VERY Important!!!

3. Calculating Date Field

4. Updating Calculated field depending on Current Date

5. Calculating date fields

6. Calculating a date field

7. calculate dates calculate time

8. Checking date fields for null (Need help very fast, Thank you)

9. Need Help Changing date format in a form field

10. Problem with time/date fields and Len Function Need Help

11. Help needed with Date field

12. Help Calculating Dates In Defined Period

 

 
Powered by phpBB® Forum Software