Solved

compare dates?

Posted on 1998-07-29
2
194 Views
Last Modified: 2010-05-03
how do i compare dates? i need like
to know where dateofbirth < dateemployed?
since dateofbirth cannot be latter than dateemployed
so it should output an error mesg..how do i do this?
how do i check whether the date_x = date_y?
0
Comment
Question by:brohans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
anthonyc earned 50 total points
ID: 1467101
if datediff("d", dateofbirth, dateemployeed) < 0 then
  msgbox "He can't work for us, he is not born yet!!"
end if

0
 
LVL 1

Expert Comment

by:Anita030598
ID: 1467102
brohans, if date_x and date_y are both of type Date then you can simply say If date_x = date_y Then
Or use any other comparision operators like <, > etc.,
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

617 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