Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11492
| Newsgroups | microsoft.public.scripting.vbscript |
|---|---|
| Date | 2016-12-26 23:49 -0800 |
| References | <10cf4ab2-f79d-4b01-a190-c25fa386b648@googlegroups.com> |
| Message-ID | <22874737-3b3e-4093-9491-68987a85f34e@googlegroups.com> (permalink) |
| Subject | Re: What is wrong with this syntax? |
| From | bart.smissaert@gmail.com |
On Sunday, 25 December 2016 23:11:45 UTC, bart.sm...@gmail.com wrote:
> Completely new to VBScript.
> Doing a simple age calculation, but have some trouble getting the Else
> If syntax right.
>
> This is the block of code:
>
> If (today_month < M) {
> age--;
> } else
> F = parseInt(30.6001 * E);
> DOM = (B - (D + F)) + (Q - Z); //day of the month
> If (DOM > today_day) {
> age--;
> }
>
> Any idea what is wrong here?
> Note that the lines with F = and DOM = only need to run if today_month < M
> is false.
>
>
> RBS
Not using this anymore.
Now instead convert the Excel date to a Julian day like this:
var jDOB = new Date((lDOB - (25569)) * 86400000);
Then I do the logic further after getting the Year and Month with the JS functions .getFullYear() and .getMonth() and if needed getDate().
This all seems to work well.
Not dealt with dates yet before 1 Jan 1900.
RBS
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Find similar
What is wrong with this syntax? bart.smissaert@gmail.com - 2016-12-25 15:11 -0800
Re: What is wrong with this syntax? "Mayayana" <mayayana@invalid.nospam> - 2016-12-25 19:20 -0500
Re: What is wrong with this syntax? bart.smissaert@gmail.com - 2016-12-25 16:26 -0800
Re: What is wrong with this syntax? bart.smissaert@gmail.com - 2016-12-25 16:50 -0800
Re: What is wrong with this syntax? "Mayayana" <mayayana@invalid.nospam> - 2016-12-25 22:16 -0500
Re: What is wrong with this syntax? bart.smissaert@gmail.com - 2016-12-26 00:06 -0800
Re: What is wrong with this syntax? "R.Wieser" <address@not.available> - 2016-12-26 09:28 +0100
Re: What is wrong with this syntax? bart.smissaert@gmail.com - 2016-12-26 04:23 -0800
Re: What is wrong with this syntax? "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2016-12-26 09:20 -0500
Re: What is wrong with this syntax? bart.smissaert@gmail.com - 2016-12-26 06:57 -0800
Re: What is wrong with this syntax? "R.Wieser" <address@not.available> - 2016-12-26 16:21 +0100
Re: What is wrong with this syntax? "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2016-12-26 14:48 -0500
Re: What is wrong with this syntax? "Mayayana" <mayayana@invalid.nospam> - 2016-12-26 16:05 -0500
Re: What is wrong with this syntax? "R.Wieser" <address@not.available> - 2016-12-26 16:06 +0100
Re: What is wrong with this syntax? Dr J R Stockton <reply1600@merlyn.demon.co.uk.invalid> - 2016-12-26 21:22 +0000
Re: What is wrong with this syntax? bart.smissaert@gmail.com - 2016-12-26 23:49 -0800
csiph-web