•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 374,198 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,589 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 175 | Replies: 1
![]() |
•
•
Join Date: Nov 2007
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
Hello,
I'm a newbie at VB and am trying to get an some help with a process. My code will check an Excel file for dates and store them in a number of variables. Then I want to be able to compare those dates to the current date. I was thinking about using "Case", but is there a smoother, better way to do this? What I want is to basically say, "If any of these dates meet the criteria, then do something."
Thanks,
Mark
I'm a newbie at VB and am trying to get an some help with a process. My code will check an Excel file for dates and store them in a number of variables. Then I want to be able to compare those dates to the current date. I was thinking about using "Case", but is there a smoother, better way to do this? What I want is to basically say, "If any of these dates meet the criteria, then do something."
Thanks,
Mark
•
•
Join Date: Feb 2008
Location: Sivakasi, Tamilnadu, India
Posts: 292
Reputation:
Rep Power: 1
Solved Threads: 52
Hi
You can use DateDiff Function to Compare dates
Interval may be
yyyy -- Year
m - Month
y - Day of year
d - Day
w - Weekday
ww - Week
h - Hour
n - Minute
s - Second
Example
You can use DateDiff Function to Compare dates
DateDiff(interval, date1, date2)
Interval may be
yyyy -- Year
m - Month
y - Day of year
d - Day
w - Weekday
ww - Week
h - Hour
n - Minute
s - Second
Example
Dim TheDate As Date ' Declare variables.
Dim Msg as String
TheDate = InputBox("Enter a date")
Msg = "Days from today: " & DateDiff("d", Now, TheDate)
MsgBox Msg Last edited by selvaganapathy : May 12th, 2008 at 12:46 pm.
KSG
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Similar Threads
- "each new axis love", "bodyplatformplatform" and "modefrag error" (Viruses, Spyware and other Nasties)
- Help me " Ticket Reservation System" (C++)
- "Forbidden / You don't have permission to access / on this server." error (Linux Servers and Apache)
- problems with Windows 2000 professional. "Systemced" error msg (Windows NT / 2000 / XP / 2003)
- Help - surf sidekick 3 is attacking! (Viruses, Spyware and other Nasties)
- spydoctor? (Viruses, Spyware and other Nasties)
- "topantispyware" virus (Viruses, Spyware and other Nasties)
- "Home Search 'Assistent'"... yet again (Viruses, Spyware and other Nasties)
- more "home search assistent" fun... (Viruses, Spyware and other Nasties)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Extracting a zip file.
- Next Thread: Sendtoback problem


Linear Mode