Question : SQL statement to create dataset where table date field is > than a datepicker.value

Hi
  I'm new to VS2008 (an old VB6 programmer), and I'm really struggling with this. I've googled until I'm blue in the face with no joy.

I'm sure it's a very simple solution. I've spent hours with no luck.

Basically, I have a table that contains a date field (Access 2007 database, and I'm using VB.Net). I have a form with DateTimepicker on it for user selection.

I'm then trying to create a dataset with an SQL statement that looks to see if the table date field (FDOB1) is a later date than the DateTimepicker value.

Any help would be appreciated, as it's a bit of a showstopper at the moment (aren't they all!)

Al
Code Snippet:
1:
sql = "SELECT NAME,SURNAME,FNAME1,FDOB1 FROM BTUC where FNAME1 <> '' and FDOB1 > " + "'" + DateTimePicker1.Value + "'"

Answer : SQL statement to create dataset where table date field is > than a datepicker.value

sql = "SELECT NAME,SURNAME,FNAME1,FDOB1 FROM BTUC where FNAME1 <> '' and FDOB1 > '" & FORMAT(DateTimePicker1.Value,"MM/dd/yyyy") & "'"


Random Solutions  
 
programming4us programming4us