Is there a way to have an if in vba that looks at two dates fields and if they are the same run one command vs if they are not the same?
Is there a way to have an if in vba that looks at two dates fields and if they are the same run one command vs if they are not the same?
You can declare them as date data types and then compare
dim dtOne as date
dim dtTwo as Date
If dtone <> dtTwo then
Do one thing
else
Do a few different things
end if
Cheers thanks![]()
Just be careful if there are hours and minutes involved. You may need to parse the time...... it can get tricky. So test and compare your results.