List Info

Thread: DataTable.Select problem with DataTime comparison




DataTable.Select problem with DataTime comparison
user name
2006-03-03 10:30:56
Hi

Was just wondering if anyone can help me solve a quick
problem?
I'm storing some data in a DataTable and I want to be able
to select
only records whose datetime is between certain values... but
I keep
hitting a problem...

versionsDataSet.Tables["versionInfo"].Select(&q
uot;changeDate > " +
Convert.ToDateTime("18/02/06"),
"changeDate"))

the actual DateTime I will be comparing against will be
dynamic, thats
just what I'm using for test purposes at the moment... but
it keeps
returning the same error:

Syntax error: Missing operand after '00' operator.

I assume this is to do with the time portion of the
string... I've
tried searching but can't find a way around this problem
without just
disregarding the time, which I don't want to do.

any suggestions?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

DataTable.Select problem with DataTime comparison
user name
2006-03-04 20:50:00
hmm .. string seems to be "  changeDate > 18/2/2006
00:00:00  ",
perhaps you should try "  changeDate > '18/2/2006
00:00:00'   " or
"changeDate > 18/2/2006" to simply connect
the date with time I've had
that problem with SQL.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopersgooglegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )