Datatable select method to select date

I have a datatable that contain column of data type datetime.

for example:
i have a column name 'Ndate' that have datavalue '03-29-2006 12:00:00AM'

i want to select rows that 'Ndate' is '03/29/2006'.

Could anyone pls tell me how can i select it using datatable.select method..?
A91627Asked:
Who is Participating?
 
tolgaongCommented:
dt.Select("[date] = #2006-03-29#)
should give you what you want.
0
 
davidrichardsonCommented:
0
 
A91627Author Commented:
Sorry. Allow me to make me clear...

Actually i want to select date only from date time column.

For example:

column [Date]
'03/29/2006 12:00:00A.M'

and i want to select it date only like
'03/29/2006'


is there any way like convert datetime to date only or select date only in datatable.select method..?

I have tried datatable.select("Convert(date, Varchar)"), but the result is a error message like this :
'Invalid datatype Varchar'

0
 
SanclerCommented:
Or, if tolgaong's suggestion doesn't work (I haven't tried it), see this

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21545297.html#14790339

That concerns a DataView .RowFilter, but the same expression rules apply to DataTable .Select.

Roger
0
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.