Solved

compare dates?

Posted on 1998-07-29
2
187 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
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now