Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error message when you try to use the DateDiff function in VBScript on a Windows Server 2003-based, Windows Vista-based, or Windows Server 2008-based computer that uses an RTL language: "Microsoft VBScript runtime error" "Type mismatch"


View products that this article applies to.

Symptoms

Consider the following scenario on a Windows Server 2003-based, Windows Vista-based, or Windows Server 2008-based computer:
  • The system locale setting is configured to use a right-to-left (RTL) language such as Hebrew or Arabic.
  • You are running Visual Basic Scripting Edition (VBScript) version 5.6 or a later version.
  • You use the FormatDateTime function in VBScript to obtain an expression string that is formatted as a date or a time.

    Note In this scenario, the string is RTL-formatted.
  • You pass the string to the DateDiff function to obtain the interval between two dates. One of the two dates is the expression from the FormatDateTime function.

In this scenario, you receive the following error message:

Microsoft VBScript runtime error
Type mismatch

↑ Back to the top


Cause

This problem occurs because the DateDiff function cannot handle RTL-formatted strings.

Note There are other functions that cannot handle RTL-formatted strings. The following other functions are also fixed in the hotfix that is mentioned in the "Resolution" section:
  • Year
  • Weekday
  • Month
  • Day
  • Datepart
  • DateAdd
  • Hour
  • Minute
  • Second

↑ Back to the top


Resolution

Hotfix information for Windows Server 2003

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

To apply this hotfix, you must have a Windows Server 2003 Service Pack 1 (SP1)-based or Windows Server 2003 Service Pack 2 (SP2)-based computer.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:
889100 How to obtain the latest service pack for Windows Server 2003

Restart requirement

You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
For all supported x86-based versions of Windows Server 2003 SP1
File nameFile versionFile sizeDateTimePlatformSP requirementService branch
Vbscript.dll5.6.0.8836401,40812-May-200909:19x86SP1SP1QFE
For all supported x86-based versions of Windows Server 2003 SP2
File nameFile versionFile sizeDateTimePlatformSP requirementService branch
Vbscript.dll5.6.0.8836401,40812-May-200909:31x86SP2SP2QFE
For all supported Itanium-based versions of Windows Server 2003 SP1
File nameFile versionFile sizeDateTimePlatformService branch
Vbscript.dll5.6.0.88361,117,69612-May-200907:07IA-64SP1QFE
Wvbscript.dll5.6.0.8836401,40812-May-200907:07x86WOW
For all supported Itanium-based versions of Windows Server 2003 SP2
File nameFile versionFile sizeDateTimePlatformService branch
Vbscript.dll5.6.0.88361,117,69612-May-200907:09IA-64SP2QFE
Wvbscript.dll5.6.0.8836401,40812-May-200907:09x86WOW
For all supported x64-based versions of Windows Server 2003 SP1
File nameFile versionFile sizeDateTimePlatformService branch
Vbscript.dll5.6.0.8836663,04012-May-200907:06x64SP1QFE
Wvbscript.dll5.6.0.8836401,40812-May-200907:06x86WOW
For all supported x64-based versions of Windows Server 2003 SP2
File nameFile versionFile sizeDateTimePlatformService branch
Vbscript.dll5.6.0.8836663,55212-May-200907:09x64SP2QFE
Wvbscript.dll5.6.0.8836401,40812-May-200907:09x86WOW

Hotfix information for Windows Vista and for Windows Server 2008

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Important Windows Vista and Windows Server 2008 hotfixes are included in the same packages. However, only one of these products may be listed on the �Hotfix Request� page. To request the hotfix package that applies to both Windows Vista and Windows Server 2008, just select the product that is listed on the page.

Prerequisites

To apply this hotfix on a Windows Vista-based computer, you must have Windows Vista SP1 or Windows Vista SP2 installed.

To apply this hotfix on a Windows Server 2008-based computer, you must have Windows Server 2008 SP1 or Windows Server 2008 SP2 installed.

Restart requirement

You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
Windows Vista and Windows Server 2008 file information notes

The MANIFEST files (.manifest) and the MUM files (.mum) that are installed for each environment are listed separately MUM and MANIFEST files, and the associated security catalog (.cat) files, are critical to maintaining the state of the updated component. The security catalog files (attributes not listed) are signed with a Microsoft digital signature.
For all supported x86-based versions of Windows Server 2008 and of Windows Vista
File nameFile versionFile sizeDateTimePlatform
Vbscript.dll5.7.0.22423434,17630-Apr-200912:20x86
Vbscript.dll5.7.0.22126430,08030-Apr-200912:05x86
For all supported x64-based versions of Windows Server 2008 and of Windows Vista
File nameFile versionFile sizeDateTimePlatform
Vbscript.dll5.7.0.22423603,64830-Apr-200912:32x64
Vbscript.dll5.7.0.22126602,62430-Apr-200912:22x64
For all supported Itanium-64-based versions of Windows Server 2008
File nameFile versionFile sizeDateTimePlatform
Vbscript.dll5.7.0.224231,153,02430-Apr-200912:16IA-64
Vbscript.dll5.7.0.221261,153,02430-Apr-200911:58IA-64

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


More information

For more information about the FormatDateTime function, visit the following Microsoft Web site:For more information about the DateDiff function, visit the following Microsoft Web site:

Additional file information for Windows Server 2008 and for Windows Vista

Additional files for all supported x86-based versions of Windows Server 2008 and of Windows Vista

File namePackage_for_kb970644_client_1~31bf3856ad364e35~x86~~6.0.1.0.mum
File versionNot Applicable
File size1,367
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_client_2~31bf3856ad364e35~x86~~6.0.1.0.mum
File versionNot Applicable
File size1,693
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_client~31bf3856ad364e35~x86~~6.0.1.0.mum
File versionNot Applicable
File size1,713
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_sc_0~31bf3856ad364e35~x86~~6.0.1.0.mum
File versionNot Applicable
File size1,421
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_sc_1~31bf3856ad364e35~x86~~6.0.1.0.mum
File versionNot Applicable
File size1,690
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_sc~31bf3856ad364e35~x86~~6.0.1.0.mum
File versionNot Applicable
File size1,701
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_server_0~31bf3856ad364e35~x86~~6.0.1.0.mum
File versionNot Applicable
File size1,425
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_server_1~31bf3856ad364e35~x86~~6.0.1.0.mum
File versionNot Applicable
File size1,694
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_server~31bf3856ad364e35~x86~~6.0.1.0.mum
File versionNot Applicable
File size1,713
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File nameX86_3f30286919879b1c0d4f677fdd34a175_31bf3856ad364e35_6.0.6002.22126_none_cd44f4569d0186b6.manifest
File versionNot Applicable
File size706
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File nameX86_fec73efdfef507b1b0222c6607dbc481_31bf3856ad364e35_6.0.6001.22423_none_e6f32f2602090406.manifest
File versionNot Applicable
File size706
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File nameX86_microsoft-windows-scripting-vbscript_31bf3856ad364e35_6.0.6001.22423_none_48d106d247121e6f.manifest
File versionNot Applicable
File size55,527
Date (UTC)30-Apr-2009
Time (UTC)14:16
PlatformNot Applicable
File nameX86_microsoft-windows-scripting-vbscript_31bf3856ad364e35_6.0.6002.22126_none_4aba79984435bf98.manifest
File versionNot Applicable
File size55,527
Date (UTC)30-Apr-2009
Time (UTC)19:10
PlatformNot Applicable

Additional files for all supported x64-based versions of Windows Server 2008 and of Windows Vista

File nameAmd64_0b9af94a628177cc26b58bd999476618_31bf3856ad364e35_6.0.6001.22423_none_9eec6c4d200e3a4c.manifest
File versionNot Applicable
File size1,060
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File nameAmd64_d8027d74129552ab9d75973e98bc18a1_31bf3856ad364e35_6.0.6002.22126_none_d1d9d51181c9e60b.manifest
File versionNot Applicable
File size1,060
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File nameAmd64_microsoft-windows-scripting-vbscript_31bf3856ad364e35_6.0.6001.22423_none_a4efa255ff6f8fa5.manifest
File versionNot Applicable
File size55,545
Date (UTC)30-Apr-2009
Time (UTC)14:27
PlatformNot Applicable
File nameAmd64_microsoft-windows-scripting-vbscript_31bf3856ad364e35_6.0.6002.22126_none_a6d9151bfc9330ce.manifest
File versionNot Applicable
File size55,545
Date (UTC)30-Apr-2009
Time (UTC)21:07
PlatformNot Applicable
File namePackage_for_kb970644_client_1~31bf3856ad364e35~amd64~~6.0.1.0.mum
File versionNot Applicable
File size1,375
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_client_2~31bf3856ad364e35~amd64~~6.0.1.0.mum
File versionNot Applicable
File size1,705
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_client~31bf3856ad364e35~amd64~~6.0.1.0.mum
File versionNot Applicable
File size1,723
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_sc_0~31bf3856ad364e35~amd64~~6.0.1.0.mum
File versionNot Applicable
File size1,429
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_sc_1~31bf3856ad364e35~amd64~~6.0.1.0.mum
File versionNot Applicable
File size1,702
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_sc~31bf3856ad364e35~amd64~~6.0.1.0.mum
File versionNot Applicable
File size1,711
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_server_0~31bf3856ad364e35~amd64~~6.0.1.0.mum
File versionNot Applicable
File size1,433
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_server_1~31bf3856ad364e35~amd64~~6.0.1.0.mum
File versionNot Applicable
File size1,706
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_server~31bf3856ad364e35~amd64~~6.0.1.0.mum
File versionNot Applicable
File size1,723
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable

Additional files for all supported Itanium-64-based versions of Windows Server 2008

File nameIa64_b4c43a2e1d16cd77c1c2198b4849c943_31bf3856ad364e35_6.0.6002.22126_none_8ce2ff48e3358cbe.manifest
File versionNot Applicable
File size1,058
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File nameIa64_dd7c9b677a5ee4a4d48bddad6d8e9fcb_31bf3856ad364e35_6.0.6001.22423_none_fff0e5f6f1a055a5.manifest
File versionNot Applicable
File size1,058
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File nameIa64_microsoft-windows-scripting-vbscript_31bf3856ad364e35_6.0.6001.22423_none_48d2aac84710276b.manifest
File versionNot Applicable
File size55,536
Date (UTC)30-Apr-2009
Time (UTC)14:42
PlatformNot Applicable
File nameIa64_microsoft-windows-scripting-vbscript_31bf3856ad364e35_6.0.6002.22126_none_4abc1d8e4433c894.manifest
File versionNot Applicable
File size55,536
Date (UTC)30-Apr-2009
Time (UTC)20:57
PlatformNot Applicable
File namePackage_for_kb970644_sc_0~31bf3856ad364e35~ia64~~6.0.1.0.mum
File versionNot Applicable
File size1,425
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_sc_1~31bf3856ad364e35~ia64~~6.0.1.0.mum
File versionNot Applicable
File size1,529
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_sc~31bf3856ad364e35~ia64~~6.0.1.0.mum
File versionNot Applicable
File size1,706
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_server_0~31bf3856ad364e35~ia64~~6.0.1.0.mum
File versionNot Applicable
File size1,429
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_server_1~31bf3856ad364e35~ia64~~6.0.1.0.mum
File versionNot Applicable
File size1,533
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable
File namePackage_for_kb970644_server~31bf3856ad364e35~ia64~~6.0.1.0.mum
File versionNot Applicable
File size1,717
Date (UTC)01-May-2009
Time (UTC)09:31
PlatformNot Applicable

↑ Back to the top


Keywords: kbautohotfix, kbexpertiseinter, kbfix, kbbug, kbsurveynew, kbqfe, kbhotfixserver, KB970644

↑ Back to the top

Article Info
Article ID : 970644
Revision : 3
Created on : 7/2/2009
Published on : 7/2/2009
Exists online : False
Views : 309