How to compare date combine from multiple date par

# Thread: How to compare date combine from multiple date par

1. Junior Member
Join Date
Dec 1969
Posts
17

## How to compare date combine from multiple date par

Start date/time and end date/time were generated by multiple date part. Day, hour, minute from drop down list, need to know how to compare end date/time &#062; start date/time use Validator.<BR><BR>Thanks ahead

2. Senior Member
Join Date
Dec 1969
Posts
655

## A little logic

If the day is bigger then it doesn&#039;t matter about the hour, if the days are the same then look at the hours, just keep working down to you find two that are not equal.<BR><BR>if day1 &#062;= hour2 then<BR>&nbsp;&nbsp;if hour1 &#062; hour2 then<BR>&nbsp;&nbsp;&nbsp;&nbsp;response.write("da y1 is greater")<BR>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp ;&nbsp;response.write("day2 is greater")<BR>&nbsp;&nbsp;end if<BR>else <BR>&nbsp;&nbsp;response.write("day2 is greater")<BR>end if

3. Senior Member
Join Date
Dec 1969
Posts
11,247

## RE: How to compare date combine from multiple date

res = sgn(datediff("m", cdate(date1 & " " & hour1 & ":" & minute1 & ":00"),cdate(date2 & " " & hour2 & ":" & minute2 & ":00")))<BR><BR>res will be -1 if 2 is greater than 1

4. Senior Member
Join Date
Dec 1969
Posts
11,247

## oops (datediff("m",

...(datediff("m", ....<BR>should be <BR><BR>(datediff("n",

5. Senior Member
Join Date
Dec 1969
Posts
655

## RE: oops (datediff(

Man, White Knight, you are the dateTime master! :-)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•