?
Solved

vbscript date

Posted on 2006-06-06
3
Medium Priority
?
220 Views
Last Modified: 2010-04-30
Hello,
I can't seem to work this out using vbscript,
I am trying to enumerate a text file that is formatted like this
groupname,folder,6/6/06,7/1/06

I am using the split function and I want to do something like this:
If Myarr(2) or Myarr(3) = today then do something

right now I have something like this:
t = Date
If Myarr(2) = t then
 msgbox "today"
end if

I can make the 2 date entries any format that makes it easier for you;
20060606,6/6/06,06/06/06

if I use VB6 it works but I would like to keep it in vbscript

Thanks for any help you can give me
0
Comment
Question by:mdiglio
  • 2
3 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 16842091
Hi mdiglio,

Try:

t = Date
If DateValue(Myarr(2)) = t then
 msgbox "today"
end if


Regards,

Patrick
0
 
LVL 16

Author Comment

by:mdiglio
ID: 16842137
Thank You
Works great!
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 16842428
mdiglio,

You're most welcome :)

Regards,

Patrick
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question