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?
That month wont work in the DataTable.Select. You can use it in MySql select though when filling

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 :-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.