VB.NET Datatable Select using MySQL Month()

Hi Experts,

I have a MySQL database that I'm pulling into a datatable in vb.net

Using the data table, I need to run a select statement using the MySQL 'Month'


MyTable.Select("OrderID In (100,110,120,130) AND Month(OrderDate)>=1 AND Month(OrderDate) <= 3)

Apparently the select doesn't have that function call defined.  Is there something else that I can use in the select statement, rather than later looping through all the DataRows that are returned and testing the date?

I also tried

MyTable.Select("OrderID IN (100,110,120,130) AND OrderDate >= #1/%/%# AND OrderDate <= #3/%/%#)

But that's not a valid date/time string.

Any suggestions?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

That month wont work in the DataTable.Select. You can use it in MySql select though when filling


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sgaggerjAuthor Commented:
Yea I was afraid of that.  I already have all my data in my data table at run time and am working with only the data table.  
I'd rather not add more calls to the DB as what i'm working on now is used by people outside of the LAN (possibly other countries)

I'll loop through the rows instead.

Thanks for your help though!
Glad to help :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.