troubleshooting Question

VB.NET Datatable Select using MySQL Month()

Avatar of sgaggerj
sgaggerjFlag for United States of America asked on
Visual Basic.NET
3 Comments1 Solution1124 ViewsLast Modified:
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'

ie

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?


ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros