Hello,

I am trying to bind an Access database to a MSChart control in VB Net 2008. I have a test database populated with four fields SAMPLE-Date\Time, Values-Number, MAX-Number and MIN-Number. I'd like to only display the rows that fall within a specific date range but I'm running into a problem when i try to execute the following command:

cmd = "SELECT SAMPLE,VALUES,MAX,MIN FROM TABLE1 WHERE [CHECK_DATE] BETWEEN 01/01/2009 AND 01/01/2011"

Can someone help me with my syntax please?
Thank alot.

Member Avatar for Unhnd_Exception

You should be able to use

cmd = "SELECT SAMPLE,VALUES,MAX,MIN FROM TABLE1 WHERE [CHECK_DATE] >= #01/01/2009# AND [CHECK_DATE] <= #01/01/2011#"

It may be also like this:
cmd = "SELECT SAMPLE,VALUES,MAX,MIN FROM TABLE1 WHERE [CHECK_DATE] BETWEEN'01/01/2009' AND '01/01/2011'";

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.