# Variable Compare Issue

**URL:** <https://www.finalbuilder.com/forums/t/variable-compare-issue/4510>\
**Category:** Discussion\
**Created:** [March 5, 2012, 11:07am UTC](https://www.finalbuilder.com/forums/t/variable-compare-issue/4510 "2012-03-05T11:07:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)\
**Post date:** [March 5, 2012, 11:07am UTC](https://www.finalbuilder.com/forums/t/variable-compare-issue/4510/1 "2012-03-05T11:07:04Z")

</div>

I&nbsp;have a variable where it prints correctly if I use "Log Variable"&nbsp;action but when I try to compare it in an "If.. Then.."&nbsp;action, it always shows blank?&nbsp;I have attached a simple sample project. Please let me know how I can solve this.

Thanks

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [March 8, 2012, 7:27am UTC](https://www.finalbuilder.com/forums/t/variable-compare-issue/4510/2 "2012-03-08T07:27:44Z")

</div>

I believe the problem is in your script :   
  
 Set MyMatchCollection = MyRegExp.Execute(“abc120101def”)   
  
 DateVar2 = MyMatchCollection.Item(0) \<\<\<\<   
  
 That will put a Regex Match object into your variable…since that’s seen as a COM object, it can’t be converted to any other type. The fix is to do this :   
  
 DateVar2 = MyMatchCollection.Item(0).Value
