Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - -edit- Calculating with dates???
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

-edit- Calculating with dates???

 Post Reply Post Reply
Author
stDeaReG View Drop Down
Newbie
Newbie


Joined: 04 June 2003
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote stDeaReG Quote  Post ReplyReply Direct Link To This Post Topic: -edit- Calculating with dates???
    Posted: 08 July 2003 at 5:54am

!!!!new question below!!!!!

Hey, I need some help, I'm doing some calculations in ASP, but in the output i get numbers like 4,56767651221 etc.

What I need the output to be in this case would be simply 4, so basicly i need to remove all numbers that appear behind the comma from my formula results.

What command do I have to use for that?

TIA.



Edited by stDeaReG
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2003 at 6:36am

strNumber = "4,3248096432"
intCommaPosition = inStr(strNumber,",")
strNumber = left(strNumber,intCommaPosition)

Back to Top
stDeaReG View Drop Down
Newbie
Newbie


Joined: 04 June 2003
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote stDeaReG Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2003 at 7:14am

thanx, another question i could use help with...

Is it possible to calculate dates, so for instance if i have a date value in my database and take the current date with now() both in the same format (like this: 8-7-2003 15:08:47).

so basicly if the database has value 8-7-2003 15:08:47 the current time is 8-7-2003 15:12:49 i would need it to output 04:02 or just 04 would do actually.

I've been trying to get it to work, but for some reason it won't

Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2003 at 7:31am

do a search for the function DateDiff()

Cheers,
Andrew

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
stDeaReG View Drop Down
Newbie
Newbie


Joined: 04 June 2003
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote stDeaReG Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2003 at 8:49am

Thanx bunches, working now.

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 08 July 2003 at 9:55am
Originally posted by stDeaReG stDeaReG wrote:

!!!!new question below!!!!!


Hey, I need some help, I'm doing some calculations in ASP, but in the output i get numbers like 4,56767651221 etc.


What I need the output to be in this case would be simply 4, so basicly i need to remove all numbers that appear behind the comma from my formula results.


What command do I have to use for that?


TIA.



Assuming the comma is the decimal delineator, then you can you either the FIX or of the INT function depending upon whether or not you want the number rounded.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.